-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Automatically detect when uv is being used #18971
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
Comments
Usually you have |
How am I meant to use mypy with uv, since the documentation only explains how to use mypy with pip? Running |
Using uv vs pip (or uvx vs pipx) doesn't actually matter per-se. What matters is whether mypy is running in the same virtual environment as where your project / its dependencies are installed. If you run mypy using Also related: #17214 |
Nevermind I somehow confused |
I wouldn't want us to automatically use |
Feature
If
.venv/bin/python
exists in the root of the project (where thepyproject.toml
file is), then automatically use it as the python executable with priority over/usr/bin/python
.Pitch
This feature would make uv work out of the box, instead of a user having to figure out that they need to add
--python-executable=.venv/bin/python
to the mypy command that they run.Alternative solutions
There could also be a help note if
.venv/bin/python
exists and mypy cannot find implementations or library stubs for the majority of the imports, that suggests adding--python-executable=.venv/bin/python
to the mypy command.The text was updated successfully, but these errors were encountered: