Skip to content

fix: align --locked metadata serializer with lock-write side#6115

Merged
wolfv merged 1 commit into
prefix-dev:mainfrom
baszalmstra:claude/investigate-issue-6049-ImRwH
May 13, 2026
Merged

fix: align --locked metadata serializer with lock-write side#6115
wolfv merged 1 commit into
prefix-dev:mainfrom
baszalmstra:claude/investigate-issue-6049-ImRwH

Conversation

@baszalmstra
Copy link
Copy Markdown
Contributor

Description

Follow-up to #6052. When [tool.uv.sources] redirects an optional-dep to a named index, uv lowering tags the registry source with index = Some(...) and Requirement::Display emits (index: <url>). The lock-write path (pixi_uv_conversions::to_requirements) strips that suffix; the --locked satisfiability path was reparsing req.to_string() with pep508_rs, which rejects it. Result: --locked errored on a lockfile pixi had just written.

Route the satisfiability path through the same to_requirements helper so both sides serialize identically.

Fixes #6049 (follow-up reported by @diegoferigo-rai on rai-opensource/exploy).

How Has This Been Tested?

  • New unit test to_requirements_strips_index_suffix_from_registry_source constructs a Requirement with index = Some(...), asserts uv's Display includes (index:, and pins to_requirements output to plain isaaclab.
  • cargo test -p pixi_core --lib lock_file::satisfiability; 150 passed, no regressions on existing test_good_satisfiability / test_failing_satisfiability cases.

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 (claude-opus-4-7, via Claude Code on web)

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added sufficient tests to cover my changes.

…ev#6049)

Follow-up to prefix-dev#6052. When `[tool.uv.sources]` redirects an
optional-dep to a named index, uv lowering tags the registry source
with `index = Some(...)` and `uv_distribution_types::Requirement`'s
`Display` emits ` (index: <url>)`. The lock-write path strips that
suffix in `to_requirements`; the `--locked` satisfiability path was
reparsing `req.to_string()` with `pep508_rs`, which rejects it.
Result: `pixi install --locked` failed on a lockfile pixi had just
written.

Route the satisfiability path through the same `to_requirements`
helper so both sides serialize identically.

https://claude.ai/code/session_017M1PznhmKaXELztjkoxckK
@wolfv wolfv merged commit e405f21 into prefix-dev:main May 13, 2026
37 checks passed
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.

Self-referential extras in pyproject.toml cause pixi.lock to always appear out of date with --locked

3 participants