SoftwareUnderstanding / inspect4py

Static code analysis package for Python repositories
https://inspect4py.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
28 stars 10 forks source link

Run in scripts is incorrect when the main type is package or library #304

Open dgarijo opened 3 years ago

dgarijo commented 3 years ago

For example, in pyLODE: run: "python /home/dgarijo/Documents/GitHub/test_repos/pyLODE/pylode/cli.py" but the cli.py script would be run through a module, as it's part of the main package.

If there is an __init.py__ in the folder, the script has to be run as a module (python -m path/to/module) If there is no __init.py__, then it's a regular script.

Another example is in code_inspector: our evaluation scripts are executable as such because there is no __init.py__. The other scrips in the repo are modules or tests.