Closed sathlan closed 1 year ago
I assume you are talking about "python -m mypy"? "python mypy" wont work i think? "python -m mypy" would?
Hi,
so python mypy does work, basically the code as provided work in my env. I agree though that the exact mechanism that makes it work doesn't feel very robust:
~/.local/bin/pylsp -> ~/.local/pipx/venvs/python-lsp-server/bin/pylsp
cd ~/.local/pipx/venvs/python-lsp-server/bin && python mypy (cwd is set by pylsp)
which is equivalent to:
~/src/my-nice-python-project/venvs/bin/python ~/.local/pipx/venvs/python-lsp-server/bin/mypy ^^^ this is overrided by the venvs loading
At least that's how I understand it worked :), but it definitively worked in my env.
Don't have a ton of time to work on this, but happy to find a better way to achieve that.
The feature set requested here is covered by the changes in #24 (as far as I am aware)
When VIRTUAL_ENV variable is present in the environment, use "python mypy" instead of "mypy" so that library loaded in the VIRTUAL_ENV get correctly loaded. This works because python is always present is the VIRTUAL_ENV, but requires that mypy to be present is the directory where the caller is. In the context of the python-lsp-server and pipx install/inject this is the case.