Skip to content

feat: Add constraints to limit dependency versions#5603

Merged
pavelzw merged 19 commits intoprefix-dev:mainfrom
delsner:delsner-constraints
Mar 17, 2026
Merged

feat: Add constraints to limit dependency versions#5603
pavelzw merged 19 commits intoprefix-dev:mainfrom
delsner:delsner-constraints

Conversation

@delsner
Copy link
Contributor

@delsner delsner commented Mar 4, 2026

Description

Fixes #3278

How Has This Been Tested?

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

.constraints
.map(|c| {
c.value
.into_inner(pixi_build_enabled)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pavelzw not so sure about this one, do you think it makes sense?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks okay to me but maybe @Hofer-Julian or @ruben-arts could take another look?

.constraints
.map(|c| {
c.value
.into_inner(pixi_build_enabled)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks okay to me but maybe @Hofer-Julian or @ruben-arts could take another look?

delsner added 5 commits March 11, 2026 09:36
- Remove .cargo-tmp/ from .gitignore (dev artifact)
- Fix doc comment comma in features_ext.rs
- Raise error for source specs in [constraints] instead of silently dropping
- Simplify satisfiability check: use by_name() and nameless_spec.matches() directly
…cate tests

- Raise a parse-time error when a source spec appears in [constraints]
  with a span-annotated miette diagnostic (regardless of pixi-build mode)
- Remove three constraint tests from target.rs that duplicated tests
  already present in manifests/workspace.rs
Instead of silently continuing when a source spec appears in [constraints]
during the lock file satisfiability check, raise a PlatformUnsat error.
This is defence-in-depth — parse-time validation already blocks source
specs in constraints, but an explicit error is clearer than a silent skip.
@delsner delsner requested a review from pavelzw March 11, 2026 09:51
@delsner delsner marked this pull request as ready for review March 11, 2026 10:50
Copy link
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, only one documentation improvement requested. Thanks for the work!

Some follow-up PRs I would love to see are:

  • Adding it to pixi list -x to see what was constraint
  • Adding it to the cli e.g. pixi add --constraint
  • Adding it to the pypi interface.

@pavelzw pavelzw merged commit 98333f8 into prefix-dev:main Mar 17, 2026
41 checks passed
@pavelzw pavelzw deleted the delsner-constraints branch March 17, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add constraints to limit dependency versions

3 participants