Repository navigation
fix: serialize PEP 508 deps as filesystem paths - #6072
Merged
Merged
Conversation
nichtmacho
reviewed
May 12, 2026
baszalmstra
approved these changes
May 12, 2026
Contributor
|
Thanks! |
1 task done
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
Pixi 0.68.0 introduced a regression where
pixi add --pypi 'name @ file:///abs/path'writes the fullfile://...URL into thepath = "..."field ofpixi.toml. The resulting manifest cannot be solved by pixi: on reload, the URL string is treated as a relativePathBufand joined with the project root.From what I understand #5607 changed
crates/pixi_pypi_spec/src/pep508.rsto wrap the parsed file path in aVerbatim, storing the user's originalfile://...string asgiven. The manifest serializer prefersgivenover the innerPathBuf, so the URL ended up under a field that expects a filesystem path.rattler_lock::Verbatim'sPartialEqonly comparesinner, ignoringgiven. The existingtest_from_argsassertion was a no-op for this class of bug becauseVerbatim::new_with_given(path, url)andVerbatim::new(path)compare equal.Dropping the URL form of
givenforfile://URLs seems to restore the pre-#5607 behavior of storing a barePathBuf, whoseDisplaycorrectly produces a filesystem path on serialization.Fixes #6071
How Has This Been Tested?
test_from_argstest_pep508_file_url_serializes_as_pathto make sure there is nofile://URL into thepath = "..."fieldcargo test -p pixi_pypi_spec --features 'pixi_spec/rattler_lock'pixi run lintAI Disclosure
Tools: Claude (Opus 4.7)
Checklist: