pyre-check
pyre-check copied to clipboard
How to support env['PYTHONPATH']
Hi, After setting the environment variable as:
export PYTHONPATH='/absolute/path/to/my/project'
I used absolute imports in different packages of my Python project. However, when I use pyre_dump(), I notice that the call graph construction fails and it cannot find the actually called functions. code directory:
. |── app │ |── api │ │ |── risk.py │ |── model │ │ |── request.py
code of file app/api/risk.py:
from model.risk_request import RiskRequest
when I change the import as below, pyre will work fine
from ..model.risk_request import RiskRequest
How can I resolve this issue?
If you expect to be able to import model.risk_request directly, then the search path you need is probably '/absolute/path/to/my/project/app' rather than '/absolute/path/to/my/project'