Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for mypy plugins installed in project #90

Open
vrslev opened this issue Sep 26, 2024 · 4 comments
Open

Support for mypy plugins installed in project #90

vrslev opened this issue Sep 26, 2024 · 4 comments

Comments

@vrslev
Copy link

vrslev commented Sep 26, 2024

Hi! Thanks for your work.

I couldn't make mypy plugins to work since python-lsp-server is separate from specific project: they would have to be installed in the same environment as python-lsp-server. Do you have any advices?

@vrslev vrslev changed the title mypy plugins installed in project don't work Support for mypy plugins installed in project Sep 26, 2024
@Richardk2n
Copy link
Member

If mypy is on PATH, that is the preferred one for pylsp-mypy.
This means you can:

  • Create a venv
  • Install mypy and your desired plugins
  • Activate the venv
  • Start your IDE/pylsp server from your base environment
  • Rejoice

@vrslev
Copy link
Author

vrslev commented Sep 26, 2024

Is there a way to specify static path that pylsp-mypy uses to find mypy instead of PATH? In my case, it's always ./.venv/bin/mypy

@Richardk2n
Copy link
Member

No, it goes for PATH first and if that does not exist it uses the one installed in the environment in which pylsp-mypy is installed.
Depending on your use case, you could have a short script wrapping your IDE/pylsp execution to prepend the appropriate path of the cwd to PATH for this execution only.

@vrslev
Copy link
Author

vrslev commented Sep 26, 2024

I’ll try it later, thanks! 😊
I’m trying to move from VSCode to Zed and this is the thing I’m stuck currently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants