Skip to content

Automatically detect when uv is being used #18971

Open
@godalming123

Description

@godalming123

Feature

If .venv/bin/python exists in the root of the project (where the pyproject.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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions