Repository navigation
Add a minimum macOS version for universal resolution - #23230
charliermarsh wants to merge 5 commits into
Conversation
| if minimum_macos_version.is_some_and(|floor| { | ||
| !floor.supports(*major, *minor, *arch == BinaryFormat::Arm64) | ||
| }) { | ||
| continue; |
There was a problem hiding this comment.
[P2] Exclude macOS tags that installation cannot accept
A package without an sdist whose only wheel targets macosx_14_1_arm64 now satisfies required ARM macOS coverage with a 15.0 floor, because supports accepts 14.1 <= 15.0. However, uv-platform-tags::compatible_tags generates only minor-zero tags for macOS 11 and later, so installation rejects that wheel. Universal wheel compatibility does not otherwise filter it. At the merge base, macos_darwin_release returned None for this tag, preventing it from satisfying coverage. Check installer-supported deployment tags before applying the optional floor, including when no floor is configured, and add a regression case.
| uv_snapshot!(context.filters(), context.lock().arg("--locked").arg("--index-url").arg(server.index_url()), @" | ||
| exit_code: 0 (success) | ||
| ----- stderr ----- | ||
| Resolved 2 packages in [TIME] | ||
| "); |
There was a problem hiding this comment.
[P3] Exercise a floor change against an existing lockfile
Both floor scenarios create a fresh lockfile and then run --locked with unchanged configuration. Consequently, removing the new ValidatedLock comparison would leave these tests passing, despite allowing a macOS-26-only pin to remain locked after lowering the floor to 14. Extend this scenario by changing only the floor to 14.0, snapshotting the --locked failure, and confirming an ordinary lock selects a==1.0.0. The neighboring minimum_libc_backtracks_and_invalidates_lock test demonstrates this pattern.
| /// A string-valued marker interpreted as a version within a platform-specific scope. | ||
| VersionString(VersionMarkerTree<'a, CanonicalMarkerValueString>), |
There was a problem hiding this comment.
[P3] Remove the unused version-node key abstraction
Deleting VersionString removes the only consumer of VersionMarkerTree with a non-default key type. The generic parameter was justified at the base, but all remaining construction now uses CanonicalMarkerValueVersion; the private fields also prevent callers from constructing alternative instances. Keeping K and its generic method and ordering bounds obscures that invariant. Specialize VersionMarkerTree and its implementations to CanonicalMarkerValueVersion. This cleanup can follow separately.
c2a716e to
53e59fe
Compare
| environments: Option<SupportedEnvironments>, | ||
| required_environments: Option<SupportedEnvironments>, | ||
| minimum_libc_version: Option<MinimumLibcVersion>, | ||
| minimum_macos_version: Option<MinimumMacosVersion>, |
There was a problem hiding this comment.
[P2] Update the existing unknown-field error snapshots
Adding this field changes Serde’s expected-field diagnostic, but show_settings::resolve_config_file and pip_install::invalid_pyproject_toml_option_unknown_field still snapshot the list without minimum-macos-version. Static comparison confirms both lists match the merge-base schema but omit this new field, causing snapshot mismatches at head. Refresh these two existing snapshots alongside the schema change.
53e59fe to
3bf0297
Compare
83b2694 to
bf6dc1f
Compare
b557dbc to
07f92e6
Compare
07f92e6 to
82b4149
Compare
82b4149 to
e70e148
Compare
e70e148 to
4922e1e
Compare
4922e1e to
a92a359
Compare
a92a359 to
6a0a066
Compare
|
That's very useful! I was drafting a feature request about exactly this, even the same option name lol, until noticed a PR. Currently, it's possible to enforce this using environments, e.g. with And it's easier to deal with Mac versions than Darwin versions as typically users see Mac version more often in wheel tags (e.g. |
Summary
After reverting #21766, macOS wheel tags contribute platform and architecture coverage during universal resolution. Projects can use
required-environmentsto require macOS wheels, but need a separate way to require support for an older macOS release.We now accept
minimum-macos-version, modeled onminimum-libc-version. uv checks wheel tags against the configured floor and backtracks if a package version lacks compatible wheels and a usable source distribution. The lock retains newer wheels for the selected version so installation can choose the best wheel for the current machine.In the two-version fixture, a floor of
14.0selectsa==1and keeps its macOS 14 and 26 wheels. A floor of26.0selectsa==2. Both locks round-trip byte for byte and export to requirements.txt and pylock.toml with ordinary platform markers. Changing the floor invalidates the previous resolution.