fix: expand extras self-refs, drop PEP 517 fallback#5992
Merged
baszalmstra merged 1 commit intoprefix-dev:mainfrom May 6, 2026
Merged
Conversation
91d9d6c to
9dd1b71
Compare
Contributor
Author
|
@nichmor The last two commits in this PR touch some of the code you wrote. Would you be able to take a look whether the changes make sense to you? |
nichmor
approved these changes
May 6, 2026
918fb8d to
fd9a664
Compare
The lockfile-v7 refactor (prefix-dev#5607) introduced `read_local_package_metadata` which fell back to `get_or_build_wheel_metadata` when uv's static `requires_dist` declined. That fallback needs the host conda prefix to have Python, but cross-platform satisfiability runs on platforms that may not be in the lock at all. The resulting `PythonMissingError` panicked out through `LazyBuildDispatch::interpreter` past this path's missing `catch_unwind`, aborting `pixi run` / `pixi reinstall` on hosts whose platform was missing from the lock (e.g. macOS arm64 against a linux-64-only lock). Restrict the function to uv's static path. `Ok(Some)` feeds drift detection; `Ok(None)` (uv's "static doesn't apply" classification) trusts the lock; `Err` surfaces as `PlatformUnsat::FailedToReadLocalMetadata` to force a re-solve. Verified for uv 0.9.5 that `database.requires_dist` itself does not invoke the interpreter. Co-authored-by: Bas Zalmstra <4995967+baszalmstra@users.noreply.github.com> https://claude.ai/code/session_018Wo78WYzQZBRWQQ3zNSsE4
fd9a664 to
454c238
Compare
nichmor
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
After the lockfile-v7 refactor (#5607),
pixi install --lockedstarted reporting false drift on a couple of common shapes. This PR fixes the satisfiability check end-to-end and adapts one stale test path along the way.test_workspace_variants_separate_work_directories: work directories moved from.pixi/build/work/<pkg>--<hash>/to.pixi/bld/<pkg>/<workspace_key>/in the lockfile-v7 refactor. The test now looks in the new location.Expand
pkg[group]self-references in staticrequires_dist: uv's staticdatabase.requires_distkeepspkg[group]self-references from[project.optional-dependencies]as-is, while build backends like hatchling write the expanded contents into the wheel METADATA at lock time. The two views compare as different, so satisfiability falsely reports the lock-file as out-of-date for any project that composes its extras (e.g. Deltares/Ribasim'sall = ["pkg[a]", "pkg[b]"]).We now run the same expansion ourselves: each
pkg[a, b]; <outer marker>is replaced by the raw entries of groupsaandbcarrying the outer marker. Cycles in the optional-deps graph (e.g.a -> b -> a) are broken on the path that closes them. The requires-dist diff message is also de-duplicated and includes extras, soadded: [pkg, pkg, pkg]becomesadded: [pkg[a], pkg[b]].Skip PEP 517 build during the satisfiability check:
read_local_package_metadatapreviously fell back toget_or_build_wheel_metadatawhen uv's staticrequires_distdeclined. That fallback needs the host conda prefix to have Python, but cross-platform satisfiability runs on platforms that may not be in the lock at all. The resultingPythonMissingErrorpanicked throughLazyBuildDispatch::interpreterpast this path's missingcatch_unwind, abortingpixi run/pixi reinstallon hosts whose platform was missing from the lock (e.g. macOS arm64 against a linux-64-only lock).The function is now restricted to uv's static path.
Ok(Some)feeds drift detection (then runs through the self-extras expansion);Ok(None)(uv's "static doesn't apply" classification) trusts the lock;Errsurfaces asPlatformUnsat::FailedToReadLocalMetadatato force a re-solve. Verified for uv 0.9.5 thatdatabase.requires_distitself does not invoke the interpreter.How Has This Been Tested?
target/release/pixifrom the branch and ranpixi install --lockedagainstDeltares/Ribasim@main(v6 lockfile): exit 0, install completes, nolock-file not up-to-dateand nometadata for local package 'ribasim' has changedin the trace. The static-only path is exercised forribasim,ribasim-api, andribasim-testmodelsper the debug log.AI Disclosure
Tools: Claude Code
Checklist: