astral-sh / uv

An extremely fast Python package installer and resolver, written in Rust.
https://astral.sh/
Apache License 2.0
11.74k stars 321 forks source link

Rewrite Python interpreter discovery #3266

Open zanieb opened 2 weeks ago

zanieb commented 2 weeks ago

Updates our Python interpreter discovery to conform to the rules described in #2386, please see that issue for a full description of the behavior. Briefly, we now will search for interpreters that satisfy a requested version without stopping at the first Python executable. We also add the plumbing necessary to request Python implementations other than CPython, though we do not add support for other implementations at this time.

A major internal goal of this work is to prepare for user-facing managed toolchains i.e. fetching a requested version during uv run. These APIs are not introduced, but there is some managed toolchain handling as required for our test suite.

Some noteworthy implementation changes:

Remaining work:

Refactors split into:

Closes #2386

codspeed-hq[bot] commented 1 week ago

CodSpeed Performance Report

Merging #3266 will not alter performance

Comparing zb/interp-request-ii (5152302) with main (18d229e)

Summary

✅ 12 untouched benchmarks