In a monorepo setting using Pantsbuild, various Python tools are installed in separate virtaulenvs like:
dist/export/python/virtualenvs/mypy/3.12.6/bin/mypy
dist/export/python/virtualenvs/ruff/3.12.6/bin/ruff
while the main source tree looks at (while it is also possible to have per-subdir lock files):
dist/export/python/virtualenvs/python-default/3.12.6/bin/python
I can override the --python-executable argument passed to mypy for the main virtualenv, but I cannot override the mypy executable path itself.
It seems to be hardcoded here:
|
if shutil.which("mypy"): |
|
# mypy exists on path |
|
# -> use mypy on path |
|
log.info("executing mypy args = %s on path", args) |
|
completed_process = subprocess.run( |
|
["mypy", *args], capture_output=True, **windows_flag, encoding="utf-8" |
|
) |
Could we make it something configurable?
In a monorepo setting using Pantsbuild, various Python tools are installed in separate virtaulenvs like:
dist/export/python/virtualenvs/mypy/3.12.6/bin/mypydist/export/python/virtualenvs/ruff/3.12.6/bin/ruffwhile the main source tree looks at (while it is also possible to have per-subdir lock files):
dist/export/python/virtualenvs/python-default/3.12.6/bin/pythonI can override the
--python-executableargument passed to mypy for the main virtualenv, but I cannot override themypyexecutable path itself.It seems to be hardcoded here:
pylsp-mypy/pylsp_mypy/plugin.py
Lines 307 to 313 in 9be427d
Could we make it something configurable?