Skip to content

feat: Use global [exclude-newer] table instead#5843

Merged
pavelzw merged 4 commits intoprefix-dev:mainfrom
pavelzw:exclude-newer-global
Apr 8, 2026
Merged

feat: Use global [exclude-newer] table instead#5843
pavelzw merged 4 commits intoprefix-dev:mainfrom
pavelzw:exclude-newer-global

Conversation

@pavelzw
Copy link
Copy Markdown
Collaborator

@pavelzw pavelzw commented Apr 8, 2026

Description

follow-up of #5786, xref #4545

Discussed with @Hofer-Julian, this is probably a cleaner approach

How Has This Been Tested?

unit tests

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: codex

prompt:

i don't like the current exclude-newer approach. let's use the following configuration structure instead:

  [workspace]
  exclude-newer = "7d"
  channels = [{ channel = "my-private-channel", exclude-newer = "0d" }, "conda-forge"]

  [exclude-newer]
  python = "0d"

  [pypi-exclude-newer]
  bolton = "0d"


  ---

  this should be not feature-specific package overrides in `constraints`, `dependencies` and `pypi-dependencies` and pypi dependency-overrides. instead, just a global table.
  dont hesitate to remove unnecessary code. update the tests accordingly

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
Copy link
Copy Markdown
Collaborator Author

pavelzw commented Apr 8, 2026

overview of all exclude-newer tests (in 46b7296 (this PR)) by codex

• Here’s the updated overview of exclude-newer test coverage.

  Parsing And Config

  - schema/test_manifest.py:205 validates schema acceptance for workspace exclude-newer, per-channel overrides, [exclude-newer], and [pypi-exclude-newer].
  - crates/pixi_manifest/src/toml/workspace.rs:386 rejects invalid exclude-newer values with a parse error.
  - crates/pixi_manifest/src/toml/channel.rs:182 checks channel-level exclude-newer parsing.
  - crates/pixi_manifest/src/manifests/workspace.rs:3477 parses [exclude-newer] and [pypi-exclude-newer] package tables.
  - crates/pixi_manifest/src/manifests/workspace.rs:3517 verifies package overrides apply.
  - crates/pixi_manifest/src/manifests/workspace.rs:3563 verifies channel overrides apply.
  - crates/pixi_spec/src/exclude_newer.rs:233 now has dedicated unit tests for invalid strings, relative cutoff timing, space-separated timestamps, and serde roundtrips, in addition to the existing
    timestamp/date/duration/display/conversion tests.

  Environment Merge And Precedence

  - crates/pixi_core/src/workspace/environment.rs:807 merges channel-specific cutoffs across multiple features.
  - crates/pixi_core/src/workspace/environment.rs:872 confirms first feature wins for duplicate channel definitions.
  - crates/pixi_core/src/workspace/environment.rs:932 checks precedence: package override > channel override > workspace cutoff.

  Conda Solve And Install

  - crates/pixi/tests/integration_rust/install_tests.rs:1460 verifies a global cutoff pushes the solve from newer foo to older foo.
  - crates/pixi/tests/integration_rust/install_tests.rs:1532 verifies a per-package override re-allows a direct dependency.
  - crates/pixi/tests/integration_rust/install_tests.rs:1578 verifies a per-package override re-allows a transitive/constraint-selected package.

  PyPI Solve

  - crates/pixi/tests/integration_rust/install_tests.rs:1634 is the online integration test for a global PyPI cutoff selecting an older boltons.
  - crates/pixi/tests/integration_rust/pypi_tests.rs:500 verifies [pypi-exclude-newer] can re-allow a package from an explicit per-package index.
  - crates/pixi/tests/integration_rust/pypi_tests.rs:611 verifies the same thing through dependency-overrides.
  - crates/pixi/tests/integration_rust/pypi_tests.rs:784 verifies relative cutoffs reject PyPI candidates without timestamps.

  Build Backend And Pixi-Build

  - crates/pixi_command_dispatcher/tests/integration/main.rs:261 verifies backend/tool env instantiation respects a global cutoff.
  - crates/pixi_command_dispatcher/tests/integration/main.rs:304 verifies backend package-specific overrides can bypass that cutoff for backend resolution.
  - crates/pixi/tests/integration_rust/build_tests.rs:549 verifies source build environments inherit exclude-newer for build dependencies.
  - crates/pixi/tests/integration_rust/build_tests.rs:632 now verifies pixi-build package overrides clear build and host dependency exclusions, leaving only the timestamp-less source package as the
    remaining blocker.

  Lockfile Satisfiability

  - crates/pixi_core/src/lock_file/satisfiability/mod.rs:2814 runs the failing fixture suite.
  - tests/data/non-satisfiability/mismatch-exclude-newer/pixi.toml covers “lock solved without exclude-newer, environment has it”.
  - tests/data/non-satisfiability/mismatch-exclude-newer2/pixi.toml stays as its own fixture, paired with its own lockfile.
  - The snapshots for both cases currently assert the locked package timestamp is newer than the environment cutoff:
      - crates/pixi_core/src/lock_file/satisfiability/snapshots/pixi_core__lock_file__satisfiability__tests__failing_satisfiability@mismatch-exclude-newer.snap
      - crates/pixi_core/src/lock_file/satisfiability/snapshots/pixi_core__lock_file__satisfiability__tests__failing_satisfiability@mismatch-exclude-newer2.snap

  Incidental Uses

  - crates/pixi/tests/integration_rust/install_tests.rs:977 uses exclude-newer only to stabilize a setuptools-related scenario.
  - crates/pixi/tests/integration_rust/upgrade_tests.rs:107 and crates/pixi/tests/integration_rust/upgrade_tests.rs:158 set exclude-newer, but the real subject is upgrade manifest rewriting.

Comment thread crates/pixi_manifest/src/features_ext.rs
@pavelzw pavelzw merged commit 50b152b into prefix-dev:main Apr 8, 2026
41 checks passed
@pavelzw pavelzw deleted the exclude-newer-global branch April 8, 2026 09:55
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.

2 participants