Repository navigation
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
ff81b62 to
65fe403
Compare
24347a1 to
3e1a356
Compare
3e1a356 to
206514f
Compare
1402f0e to
391cdce
Compare
| let mut custom = default.clone(); | ||
| custom.key = custom | ||
| .key | ||
| .with_build_name(PythonBuildName::from_str("custom").unwrap()); | ||
|
|
||
| assert!(!custom.is_upgrade_of(&default)); | ||
| assert!(!default.is_upgrade_of(&custom)); |
There was a problem hiding this comment.
[P3] Exercise an otherwise valid upgrade in the build-name test
Both installations are 3.10.8 with no build revision, so both assertions still pass if the build-name guard is removed: the existing same-version logic already returns false. This duplicates test_is_upgrade_of_same_version without protecting the new invariant. Give the candidate a newer patch or build revision, verify that matching build names permit the upgrade, then verify that differing names prevent it.
| fn executable_name_variant_suffix(&self) -> String { | ||
| self.variant.executable_suffix().to_string() | ||
| } |
There was a problem hiding this comment.
[P3] Keep executable variant suffixes borrowed
PythonVariant::executable_suffix() already returns &'static str. This wrapper adds a temporary heap allocation for every nonempty suffix, which all three executable-name formatters immediately interpolate and discard. It introduces no build-name-specific behavior. Retain the direct calls to the existing helper, or return the borrowed suffix here.
Represent publisher-defined build names as part of managed Python installation identity. Normalize user-provided names to lowercase and restrict names to `[a-z][a-z0-9_]*`. Keep Python variants distinct from build names and use named and unnamed build terminology throughout key parsing, display, ordering, and tests.
95038b6 to
2b1759b
Compare
Summary
Represent publisher-defined build names as part of managed Python installation identity. Normalize user-provided names to lowercase and restrict names to
[a-z][a-z0-9_]*.Keep Python variants distinct from build names and use named and unnamed build terminology throughout key parsing, display, ordering, and tests.
Stack: 1 of 7.
Test plan
cargo fmt --all --checkcargo test --locked -p uv-python