|
|
|
|
|
by cubes
1488 days ago
|
|
This looks really neat. One thing I noticed on reading the source code, it appears to actually import the modules: Quoting the docstring on the `track_module` function: """This function executes the tracking of a single module by launching a
subprocess to execute this module against the target module. The
implementation of thie tracking resides in the __main__ in order to
carefully control the import ecosystem.
Source: https://github.com/IBM/import-tracker/blob/67a1e84e5a609e52e...Here's the actual subprocess call:
https://github.com/IBM/import-tracker/blob/67a1e84e5a609e52e... # Launch the process
proc = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, env=env)
I think this is clever, and maybe even necessary, but feels risky to do on unaudited third-party Python libraries.Maybe I'm misunderstanding something? |
|
This is why my coworker built the project he called "dowsing"; it tries to understand as much as possible from the setup.py's AST, without actually executing it.
https://github.com/python-packaging/dowsing