Skip to content

feat(manifest): read exemptions from exclude-newer in [workspace] - #7246

Merged
lucascolley merged 12 commits into
mainfrom
exclude-newer-exemptions-2-manifest
Oct 15, 2026
Merged

lucascolley merged 12 commits into
mainfrom
exclude-newer-exemptions-2-manifest

Conversation

@pavelzw

@pavelzw pavelzw commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Description

exclude-newer keeps accepting a bare cutoff string, and now also takes
a table with a cutoff and exemptions:

[workspace.exclude-newer]
cutoff = "7d"
exemptions = { py-rattler = "*", polars = "1.43.1" }

Exemptions are match specs, so a single vetted release can be allowed
through without lowering the cutoff for every future release of the
package. The cutoff is required in the table form, since exemptions
without one would do nothing.

pypi-exclude-newer is added to [workspace] with the same shape. Its
cutoff is optional and falls back to the conda cutoff. Exemptions only
support "*" for now because uv can only lift the cutoff per package.

Part of #7179 and #6479.

Stack (review and merge in order):

  1. feat(spec): support exemptions in the resolved exclude-newer config #7250
  2. feat(manifest): read exemptions from exclude-newer in [workspace] #7246 👈 this PR
  3. feat(lock): honor exclude-newer exemptions in satisfiability #7247
  4. feat(manifest): deprecate the top-level exclude-newer tables #7248
  5. feat(global): use match spec exemptions in exclude-newer #7249
  6. docs: document exclude-newer exemptions #7251
  7. chore: update rattler and rattler-build crates #7267

How Has This Been Tested?

cargo test -p pixi_manifest -p pixi_global -p pixi_core, plus cargo test -p pixi --test integration_rust exclude_newer. Adds parser tests for the bare and table forms, rejected exemption fields, the PyPI cutoff fallback, and integration tests for conda and PyPI exemptions against mock channels and indexes.

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 Code

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.

@pavelzw pavelzw changed the title feat(lock-file): honor exclude-newer exemptions in satisfiability feat(manifest): read exemptions from exclude-newer in [workspace] Oct 13, 2026
@pavelzw
pavelzw added this pull request to stack #7252 October 13, 2026 09:02
@pavelzw
pavelzw force-pushed the exclude-newer-exemptions-2-manifest branch 2 times, most recently from db6d70d to b87f59c Compare October 13, 2026 11:37
@pavelzw
pavelzw force-pushed the exclude-newer-exemptions-2-manifest branch from b87f59c to 05bee0d Compare October 13, 2026 13:20
@pavelzw
pavelzw marked this pull request as ready for review October 13, 2026 13:22
@pavelzw
pavelzw force-pushed the exclude-newer-exemptions-2-manifest branch 2 times, most recently from 5fa04ce to 05c974a Compare October 13, 2026 13:56
@pavelzw
pavelzw force-pushed the exclude-newer-exemptions-2-manifest branch from 05c974a to 9c96304 Compare October 13, 2026 20:49
Base automatically changed from exclude-newer-exemptions-1-solve to main October 14, 2026 13:33
`exclude-newer` keeps accepting a bare cutoff string, and now also takes
a table with a `cutoff` and `exemptions`:

    [workspace.exclude-newer]
    cutoff = "7d"
    exemptions = { py-rattler = "*", polars = "1.43.1" }

Exemptions are match specs, so a single vetted release can be allowed
through without lowering the cutoff for every future release of the
package.

`pypi-exclude-newer` is added to `[workspace]` with the same shape. Its
`cutoff` is optional and falls back to the conda cutoff. Exemptions only
support `"*"` for now because uv can only lift the cutoff per package.
An exemption written as an empty table, such as `polars = {}`, was
accepted and matched every release of the package, the same as `"*"`.
Exemptions loosen a supply-chain control, so a typo there should fail
loudly instead of exempting the package entirely.

Dependencies already reject an empty table, but that check lives in the
conversion to a full spec and not in the one to a binary spec that
exemptions use. The error points to `"*"` for exempting every release,
and leaves out `url`, `git` and `path`, which exemptions reject anyway.
The doc comment of the saturating timestamp conversion referred to the
resolver in `features_ext.rs` for where the "never exclude by default"
sentinel comes from. That resolver moved to `resolve_exclude_newer` in
the manifest's `exclude_newer` module, so the reference was dangling.
The schema typed exemption tables like binary dependency tables, so it
disagreed with pixi in both directions. It accepted `extras` and `when`,
which pixi rejects because they do not select packages. It rejected
`md5` and `sha256`, which pixi accepts, so editors flagged the most
precise exemption: one vetted artifact pinned by its hash.

The selector fields now live in a shared base table, with the binary
dependency table adding `extras` and `when` on top and the exemption
table adding the hashes. Exemption tables must also have at least one
field, matching the parser's rejection of empty tables. Moving the
fields reorders the binary dependency table's properties in the
generated schemas without changing what they accept.
The examples exempted `polars = "1.43.1"`. A bare version like that is
an ambiguous specifier, so pixi warns that it will become an error in
the future. Examples that users copy should not trigger that warning,
so they now use `"==1.43.1"`, matching the `pixi global` docs.

Tests keep the bare version on purpose, since it is still accepted.

@lucascolley lucascolley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks Pavel, please could you review the four commits I just pushed?

A couple comments inline also

…newer configs

Nothing in this change serializes the parsed configuration. The conda
impl moves to the global manifest change that writes it back to disk.
@pavelzw

pavelzw commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

the four commits look good. i also took care of your pr comments.

The conda and PyPI parsers were copies of each other apart from whether
the cutoff is required and how the exemptions are read. A shared helper
takes those two differences as arguments, so the error handling for the
string and table forms lives in one place.
Listing every field of the detailed spec to spot a bare version took 16
lines. Comparing against a spec that carries only the version does the
same, and still holds when a field is added to the spec later.
…ests

Each exclude-newer test declared its own copy of the same struct and
trait impls to call the resolver on the default feature, and this
branch added two more copies. One wrapper next to the tests replaces
all four.
Three test modules built the same timestamped repodata record by hand
to check what an exclude-newer configuration excludes, and this branch
added two of them. The builder now lives in `pixi_test_utils`, with an
optional channel for the tests that check channel-specific exemptions.

@lucascolley lucascolley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

pushed 4 more commits for you to review, plus one comment inline

@pavelzw

pavelzw commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

your commits look good, thanks! also resolved your inline comment

@pavelzw
pavelzw requested a review from lucascolley October 15, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants