pyre-check
pyre-check copied to clipboard
Exclude should not exclude search_path
I use pdm to manage my local packages. It supports PEP582. Thus, my directory tree is like this:
.
├── __pypackages__
│ └── 3.8
│ ├── lib
│ │ ├── package1
│ │ ├── packages
...
├── xxxx.py
├── pdm.lock
└── pyproject.toml
When we use pyre, we want to ignore the __pypackages__
folder.
PEP582 uses __pypackages__
as the local packages directory. When we use pyre, we should add a path like __pypackages__/3.8/lib
to search_path
.
So one example config file here:
{
"binary": "/Users/Nasy/Library/Python/3.8/bin/pyre.bin",
"source_directories": [
"."
],
"taint_models_path": "/Users/Nasy/Library/Python/3.8/lib/pyre_check/taint/",
"typeshed": "/Users/Nasy/Library/Python/3.8/lib/pyre_check/typeshed/",
"exclude": [".*/__pypackages__/.*"],
"search_path": ["./__pypackages__/3.8/lib/"]
}
Now if we use pyre check
, it will tell you that
xxxx.py:4:0 Undefined import [21]: Could not find a module corresponding to import `package1`.
I guess this is incorrect behaviour. pyre should not ignore the search path when the search path is one of the excluded folders.
cc: @shannonzhu @grievejia this might be relevant for the config changes that have been discussed.