Module Expr Str ImportFrom alias Import alias Import alias ImportFrom alias alias alias alias Import alias ImportFrom alias FunctionDef arguments args defaults body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr Call NameLoad NameLoad Str Str keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Assert CompareEq NameLoad Str BinOpAdd Str Call AttributeLoad NameLoad attr decorator_list NameLoad
N/A N/A 
Checks that SymPy does not contain indirect imports.

An indirect import is importing a symbol from a module that itself imported the
symbol from elsewhere. Such a constellation makes it harder to diagnose
inter-module dependencies and import order problems, and is therefore strongly
discouraged.

(Indirect imports from end-user code is fine and in fact a best practice.)

Implementation note: Forcing Python into actually unloading already-imported
submodules is a tricky and partly undocumented process. To avoid these issues,
the actual diagnostic code is in bin/diagnose_imports, which is run as a
separate, pristine Python process.
 __future__ print_function N/A subprocess N/A sys os.path abspath dirname join normpath N/A inspect sympy.utilities.pytest XFAIL test_module_imports_are_direct N/A N/A N/A N/A N/A my_filename N/A abspath N/A N/A inspect getfile N/A N/A inspect currentframe N/A my_dirname N/A dirname my_filename N/A diagnose_imports_filename N/A join my_dirname diagnose_imports.py N/A diagnose_imports_filename N/A normpath diagnose_imports_filename N/A process N/A N/A subprocess Popen N/A N/A sys executable N/A normpath diagnose_imports_filename --problems --by-importer stdout N/A subprocess PIPE stderr N/A subprocess STDOUT bufsize -1 N/A N/A output _ N/A N/A process communicate N/A N/A output N/A There are import problems:
 N/A N/A output decode N/A XFAIL