mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-10 05:39:12 +00:00
![]() ## Summary Updates the `--python` flag to accept Python executables in virtual environments. Notably, we do not query the executable and it _must_ be in a canonical location in a virtual environment. This is pretty naive, but solves for the trivial case of `ty check --python .venv/bin/python3` which will be a common mistake (and `ty check --python $(which python)`) I explored this while trying to understand Python discovery in ty in service of https://github.com/astral-sh/ty/issues/272, I'm not attached to it, but figure it's worth sharing. As an alternative, we can add more variants to the `SearchPathValidationError` and just improve the _error_ message, i.e., by hinting that this looks like a virtual environment and suggesting the concrete alternative path they should provide. We'll probably want to do that for some other cases anyway (e.g., `3.13` as described in the linked issue) This functionality is also briefly mentioned in https://github.com/astral-sh/ty/issues/193 Closes https://github.com/astral-sh/ty/issues/318 ## Test Plan e.g., ``` uv run ty check --python .venv/bin/python3 ``` needs test coverage still |
||
---|---|---|
.. | ||
cli.md | ||
configuration.md | ||
mypy_primer.md | ||
rules.md | ||
tracing-flamegraph.png | ||
tracing.md |