Skip to content

fix(spec): allow extras and flags on source dependency specs#6274

Closed
hunger wants to merge 1 commit into
prefix-dev:mainfrom
hunger:push-mnqkvvsttlvr
Closed

fix(spec): allow extras and flags on source dependency specs#6274
hunger wants to merge 1 commit into
prefix-dev:mainfrom
hunger:push-mnqkvvsttlvr

Conversation

@hunger
Copy link
Copy Markdown
Contributor

@hunger hunger commented Jun 3, 2026

The manifest reference promises requesting a source package's extra-dependencies group via 'pkg = { path = "...", extras = [...] }', but the TOML spec validation swept 'extras' and 'flags' into the blanket source-spec rejection list, so they only worked on binary specs.

Carry both fields on the manifest-side PathSpec, UrlSpec, and GitSpec and hoist them into SourceSpec on conversion; location copies (which end up in lock-file sources maps) always stay clean. Binary archives ('.conda', '.tar.bz2') reject the fields with a dedicated error since they cannot honor them.

Two consistency fixes ride along so the feature doesn't thrash the lock file:

  • The satisfiability walker now traverses the experimental_extra_depends entries of requested extras (per package+extra pair) and rejects locked records that don't provide a requested group. Previously extras-activated packages were unreachable and every install re-solved.
  • The conda solve validates requested extras (direct, dev-source, and transitive depends strings) against the solved records, because the solver itself treats extras as conditional activation and silently ignores unknown groups. Typos now fail loudly with the available groups.

The passthrough test backend forwards [package.extra-dependencies] from the project model so integration tests can exercise the full pipeline.

StringMatcher is added to clippy's ignore-interior-mutability list: its Hash/Eq derive from the pattern string, the interior mutability is only a lazily-built regex cache.

Description

Fixes #{issue}

How Has This Been Tested?

More 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: 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.

The manifest reference promises requesting a source package's
extra-dependencies group via 'pkg = { path = "...", extras = [...] }',
but the TOML spec validation swept 'extras' and 'flags' into the blanket
source-spec rejection list, so they only worked on binary specs.

Carry both fields on the manifest-side PathSpec, UrlSpec, and GitSpec and
hoist them into SourceSpec on conversion; location copies (which end up in
lock-file sources maps) always stay clean. Binary archives ('.conda',
'.tar.bz2') reject the fields with a dedicated error since they cannot
honor them.

Two consistency fixes ride along so the feature doesn't thrash the lock
file:

- The satisfiability walker now traverses the experimental_extra_depends
  entries of requested extras (per package+extra pair) and rejects locked
  records that don't provide a requested group. Previously extras-activated
  packages were unreachable and every install re-solved.
- The conda solve validates requested extras (direct, dev-source, and
  transitive depends strings) against the solved records, because the
  solver itself treats extras as conditional activation and silently
  ignores unknown groups. Typos now fail loudly with the available groups.

The passthrough test backend forwards [package.extra-dependencies] from
the project model so integration tests can exercise the full pipeline.

StringMatcher is added to clippy's ignore-interior-mutability list: its
Hash/Eq derive from the pattern string, the interior mutability is only a
lazily-built regex cache.
@hunger hunger requested a review from baszalmstra June 3, 2026 17:54
@baszalmstra
Copy link
Copy Markdown
Contributor

@Hofer-Julian has multiple PRs open that address this.

@hunger
Copy link
Copy Markdown
Contributor Author

hunger commented Jun 3, 2026

Sorry, I ended up here as I was trying to do a tutorial and discovered this is not implemented yet. Without source dependencies having these options, it is really hard to demo this feature as I can not find interesting binary packages ;-)

I hoe I have not misunderstood the entire thing :-)

@hunger hunger closed this Jun 3, 2026
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