Skip to content

Conversation

@baszalmstra
Copy link
Collaborator

@baszalmstra baszalmstra commented Jul 21, 2025

Uses conditional dependency support in resolve to implement extras. Result of some late-night hacking with @wolfv .

Extras a written as condition dependencies, e.g. if a package foo has an optional dependency group called bar

"foo": {
  "extra-depends": {
    "bar": ["numpy"]
  }
}

Then conditional requirements are added for foo in the form of: numpy; if foo[bar]. We add a special "extra" package that represents foo[bar]. So as a user depends on foo with bar (foo[bar]), numpy will also be selected.

This also adds extras in a different way. Extras are completely optional now, so if a user depends on an extra that doesnt exist the solver will happily continue. Its up to users of the library to warn if an extra is selected that is not actually available for the selected package.

@baszalmstra baszalmstra requested a review from wolfv July 23, 2025 19:32
@baszalmstra baszalmstra marked this pull request as ready for review July 23, 2025 19:32
@wolfv
Copy link
Contributor

wolfv commented Jul 27, 2025

The benchmarks show a inconsistent difference of +-3% which seems fine to me!

@wolfv
Copy link
Contributor

wolfv commented Jul 30, 2025

ugh, somehow the extras printing adds a single space after ]? I checked and it doesn't seem to come from this code.

@wolfv
Copy link
Contributor

wolfv commented Jul 30, 2025

I think prefix-dev/resolvo#164 should fix this.

@baszalmstra
Copy link
Collaborator Author

I updated the resolvo dependencies, merged main, and fixed the thing you find. This looks good from my perspective @wolfv

@wolfv wolfv merged commit acd5ccf into conda:main Aug 11, 2025
18 checks passed
@wolfv
Copy link
Contributor

wolfv commented Aug 11, 2025

Awesome stuff! I think now I need to rebase my PR in #1545

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