Repository navigation
Conversation
b46cbce to
c5b0afd
Compare
c5b0afd to
1d60fbe
Compare
Merging this PR will not alter performance
|
1d60fbe to
a54c91c
Compare
| if let Some(filter) = python_patch_version_filter(version, actual_version) { | ||
| filters.push(filter); |
There was a problem hiding this comment.
[P2] Refresh the remaining snapshots affected by the filter
With Python 3.12.9 from .python-versions, this filter leaves 3.12.1 and 3.12.0 intact, but two snapshots still expect them masked. lock_group_includes_requires_python retains blargh = ">=3.12.[X],>=3.13" at crates/uv/tests/lock/lock.rs:33465. The it__ecosystem__semantic-kernel-lock-file.snap snapshot also retains 3.12.[X] in the google-cloud-storage version and its two artifact URLs. Both tests will consequently fail their snapshot assertions. Update these remaining literals to 3.12.1 and 3.12.0, respectively.
43c3a05 to
efc1cd6
Compare
efc1cd6 to
8c32dfe
Compare
| if let Some(filter) = python_patch_version_filter(version, actual_version) { | ||
| filters.push(filter); |
There was a problem hiding this comment.
[P2] Create the test venv from the interpreter used by the filter
The discovered interpreter is not necessarily the one used by TestContext::create_venv(), which independently calls get_python(). For example, with an active base Conda interpreter at 3.12.7 and a managed installation at 3.12.9, discovery selects Conda while get_python() selects the managed installation. This filter then masks only 3.12.7, leaving the venv’s 3.12.9 visible and breaking snapshots such as pip_check::check_python_version. The previous filter masked both patches. Reuse the saved executable when creating or resetting the venv so interpreter selection and snapshot filtering agree.
| let v3_1 = PythonVersion::from_str("3.1").unwrap(); | ||
| let matched: Vec<_> = installations.find_version(&v3_1).unwrap().collect(); | ||
| let request = VersionRequest::from(&v3_1); | ||
| let matched: Vec<_> = installations | ||
| .iter() | ||
| .filter(|installation| request.matches_installation_key(installation.key())) | ||
| .collect(); |
There was a problem hiding this comment.
[P3] Move the retained version-matching test to its owning layer
With find_version removed, this test reconstructs its filtering locally. Production discovery uses VersionRequest::matches_version, while matches_installation_key now has only these test callers. The temporary installation tree, host-platform detection, and process-global environment mutation therefore no longer exercise the production version-selection path. Move the 3.1 versus 3.10 regression into the existing VersionRequest tests, exercising the production matcher directly, and remove this obsolete filesystem-based reconstruction.
8c8d91f to
677a48a
Compare
| let request = VersionRequest::try_from(version) | ||
| .map_err(|_| Error::InvalidPythonVersion(version.to_string()))?; |
There was a problem hiding this comment.
[P3] Remove the error variant left behind by find_version
This was the only construction site of uv_python_managed::Error::InvalidPythonVersion. Removing the helper leaves a public error variant describing a failure the crate no longer produces, making its error API misleading. Remove the variant and its #[error] attribute alongside this method.
TestContextmasks every patch number that shares a requested Python minor version, which can hide literal interpreter requests, package versions, and Python constraints in snapshots. Retain the interpreter version already found during setup and mask only its selected patch unless an exact patch was requested. Restore the unrelated version literals in the affected snapshots.Refs astral-sh#14008.