Open jakeanq opened 5 months ago
it skam
Pylyzer obtains sys.path
(including $PYTHONPATH
) from the Python interpreter in the current environment to resolve imports.
Therefore, if the interpreter settings are correct, $PYTHONPATH
should automatically be included in the path candidates for import resolution.
The python interpreter used can be changed via tool.pylyzer.python.path
in pyproject.toml
.
https://github.com/mtshiba/pylyzer/blob/main/docs/source/pyproject.md
As far as I can see there is currently no support for searching locations specified on
$PYTHONPATH
, so this is a request for adding that.This would be useful in order to be able to typecheck dependencies that live in arbitrary locations or when working with package managers such as
nix
(I assumenix
uses$PYTHONPATH
but I haven't actually confirmed this) orrez
.Potentially it could also be useful to be able to specify search paths on the CLI in order to run type checking on a different environment to the one which is running
pylyzer
.