Add per-index exclude-newer overrides for PyPI extra indexes#6360
Draft
pavelzw wants to merge 1 commit into
Draft
Add per-index exclude-newer overrides for PyPI extra indexes#6360pavelzw wants to merge 1 commit into
exclude-newer overrides for PyPI extra indexes#6360pavelzw wants to merge 1 commit into
Conversation
Allow `[pypi-options].extra-index-urls` entries to be inline tables that
carry their own `exclude-newer`, mirroring conda's `ChannelInlineTable`:
extra-index-urls = [
"https://pypi.org/simple",
{ url = "https://internal/simple", exclude-newer = false },
{ url = "https://other/simple", exclude-newer = "2025-01-01" },
]
`exclude-newer = false` disables the cutoff for that index, which fixes
solves against private mirrors that do not expose PEP 700 `upload-time`
(where any global cutoff would otherwise exclude every file). A
date/duration/timestamp sets a per-index cutoff; omitting it inherits the
global one.
The override is plumbed onto uv's `Index.exclude_newer` and applied during
resolution. pixi now opts into uv's `index-exclude-newer` preview feature so
this works without panicking on the uninitialized preview state.
Closes #6158
https://claude.ai/code/session_01DbjDfm5GLLeu9pR8XQy7hy
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
This PR adds support for per-index
exclude-neweroverrides on PyPI extra indexes, allowing users to customize the package cutoff date for individual indexes. This is particularly useful for private mirrors that do not exposeupload-timemetadata.Key Changes:
New
PypiExtraIndexstruct (crates/pixi_manifest/src/pypi/pypi_options.rs):Vec<Url>withVec<PypiExtraIndex>to carry both URL and optional per-indexexclude-neweroverridefrom_url()constructor for simple casesNew
IndexExcludeNewerenum (crates/pixi_spec/src/exclude_newer.rs):false) or specifying a custom cutoff for an indexExcludeNewerby supporting explicit disabling, which is required for indexes withoutupload-timemetadataTOML deserialization support (
crates/pixi_manifest/src/toml/pypi_options.rs):PypiExtraIndexandIndexExcludeNewer{ url = "...", exclude-newer = ... }exclude-newer = trueis rejected with a helpful error messageuv integration (
crates/pixi_uv_conversions/src/conversions.rs):ExcludeNewerOverrideon eachIndexNone(inherit global),Disabled, and custom cutoff valuesSchema updates (
schema/model.pyand JSON schemas):ExtraIndexInlineTabledefinitionextra-index-urlsto accept both URL strings and inline tablesExample Usage:
How Has This Been Tested?
crates/pixi_manifest/src/toml/pypi_options.rs:test_deserialize_extra_index_urls_with_exclude_newer: validates parsing of all three formatstest_extra_index_exclude_newer_true_is_error: ensurestrueis rejected with helpful errortest_extra_index_missing_url_is_error: validates requiredurlfieldcrates/pixi_uv_conversions/src/conversions.rs:test_per_index_exclude_newer_is_applied: verifies per-index overrides are correctly applied to uv indexesPypiExtraIndexstructureChecklist:
schema/model.pyhttps://claude.ai/code/session_01DbjDfm5GLLeu9pR8XQy7hy