Skip to content

Commit e1313df

Browse files
committed
Add a script to test imports
1 parent 08c5b8a commit e1313df

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

scripts/check_imports.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""
2+
Check that certain modules are not loaded by `import pandas`
3+
"""
4+
import sys
5+
6+
7+
blacklist = {
8+
'matplotlib',
9+
'numexpr',
10+
'xlsxwriter',
11+
'openpyxl',
12+
'xlwt',
13+
'numexpr',
14+
}
15+
16+
17+
def main():
18+
import pandas # noqa
19+
20+
modules = set(x.split('.')[0] for x in sys.modules)
21+
imported = modules & blacklist
22+
if modules & blacklist:
23+
sys.exit("Imported {}".format(imported))
24+
25+
26+
if __name__ == '__main__':
27+
main()

0 commit comments

Comments
 (0)