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:
The uv_interpreter::find_python module has been removed in favor of a uv_interpreter::discovery module.
There are new types to help structure interpreter requests and track sources
Executable discovery is implemented as a big lazy iterator and is a central authority for source precedence
uv_interpreter::Error variants were split into scoped types in each module
Remaining work:
[ ] Write and merge new test cases to main
[x] Fix Windows test cases
[ ] Explore behavior around implementation precedence (i.e. CPython over PyPy)
Future: Combine PythonVersion and VersionRequest
Future: Consider splitting ManagedToolchain into local and remote variants
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:
uv_interpreter::find_python
module has been removed in favor of auv_interpreter::discovery
module.uv_interpreter::Error
variants were split into scoped types in each moduleRemaining work:
main
PythonVersion
andVersionRequest
ManagedToolchain
into local and remote variantsRefactors split into:
3329
3330
3331
3332
Closes #2386