uv/crates/uv-python
Zanie Blue ec480bd3ee
Allow discovering virtual environments from the first interpreter found on the PATH (#11218)
Closes https://github.com/astral-sh/uv/issues/11214

Special-cases the first Python executable we find on the `PATH`,
allowing it to be considered during searches for virtual environments.

For some context, there are two stages to Python interpreter discovery

1. We find possible Python executables in various sources
2. We query the executables to determine canonical metadata about the
interpreter

We can't really be "sure" if an executable is a complaint virtual
environment during (1), we need to query the interpreter first. This
means that if you're only allowed to installed into virtual
environments, we'll query every interpreter on your PATH. This is not
performant, and causes confusion for users. Notably, I recently improved
error messaging when we can't find any valid interpreters, by showing
the error message we encounter while querying an interpreter (if any).
However, this is problematic when there's an error for an interpreter
that is not relevant to your search. In
https://github.com/astral-sh/uv/pull/11143, I added filtering to avoid
querying additional interpreters, but that regressed some user
experiences where they were relying on us finding implicitly active
virtual environments via the PATH.
2025-02-04 15:41:37 -06:00
..
python Use explicit _GLibCVersion tuple in uv-python crate (#11122) 2025-01-31 11:52:38 +01:00
src Allow discovering virtual environments from the first interpreter found on the PATH (#11218) 2025-02-04 15:41:37 -06:00
Cargo.toml Install and remove managed Python to and from the Windows Registry (PEP 514) (#10634) 2025-01-23 14:13:41 +00:00
download-metadata.json Sync latest Python releases (#10637) 2025-01-15 12:55:31 -06:00
fetch-download-metadata.py Update references to python-build-standalone to reflect the transferred project (#9977) 2024-12-17 20:19:58 +00:00
template-download-metadata.py Update riscv64 Python downloads to allow install on riscv64gc (#10937) 2025-01-24 09:33:29 -06:00