Doesn't work on Python project with `src` layout
debakarr opened this issue · 1 comments
debakarr commented
Take for example https://github.com/pyca/cryptography
I tried dep-tree-explorer with the following input:
- GitHub Project: https://github.com/pyca/cryptography
- Entrypoint: src/cryptography/init.py
gabotechs commented
That happens because absolute imports are resolved from the root of the project, and the code is nested under src
, but absolute imports in that codebase assume that there's no src
folder.
You can overcome this using the environment variable PYTHONPATH like this:
export PYTHONPATH=src
and dep-tree will also resolve absolute imports that live in the src
folder