feat: refactor pixi pypi spec#5155
Merged
tdejager merged 2 commits intoprefix-dev:mainfrom Dec 18, 2025
Merged
Conversation
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
nichmor
approved these changes
Dec 18, 2025
ruben-arts
pushed a commit
to ruben-arts/pixi
that referenced
this pull request
Dec 22, 2025
This refactors PixiPypiSpec to follow UV's pattern with a struct + source enum design.
The new design separates:
PixiPypiSource enum with variants: Registry, Git, Path, Url
PixiPypiSpec struct with extras and source fields
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
I was looking into how to marry
tool.uv.sourcesfrom pyproject and ourpypi-dependenciesinto a more coherent design. Currently we do not allow for a top-leveltool.uv.sourcesat all, and I wanted to change that. I then quickly ran into the fact that our design differs from the uv way of looking quite a bit. So decided to do this refactor first.This refactors
PixiPypiSpecto follow UV's pattern with a struct + source enum design.The new design separates:
PixiPypiSourceenum with variants:Registry,Git,Path,UrlPixiPypiSpecstruct withextrasandsourcefieldsThis makes the code cleaner because you can now access
spec.extrasdirectly without having to match on every variant. It also aligns better with how uv structures theirRequirement+RequirementSourcetypes, which makes the mental model easier when working with both codebases.Also renamed
is_direct_dependencytois_source_dependencyas that's a bit more descriptive for what it actually checks.How Has This Been Tested?
Ran the full
pixi r test-slowsuite - 931 tests pass. Also verified backwards compatibility by checking that the TOML serialization format stays the same (simple version strings like">=1.0"still work, as do table formats with extras/index).AI Disclosure
Tools: Claude Opus 4.5
Checklist: