CEP 43: Conditional dependencies - #164
Conversation
Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
Co-authored-by: Lucas Colley <lucas.colley8@gmail.com>
Co-authored-by: Bas Zalmstra <4995967+baszalmstra@users.noreply.github.com>
|
Dear @conda/steering-council, The vote for this CEP has started. It will be open for two weeks, until May 11th, 2026, 23:59 Anywhere on Earth. This time period has been chosen to make it eligible for time-out rules. As an Enhancement Proposal vote, it requires 60% affirmative votes to pass. To vote, please mark the relevant checkbox under your username:
|
| A conditional dependency is defined as a `MatchSpec` string that features a `when` keyword, the value of which MUST be a string that encodes a logical expression of one or more `MatchSpec` queries. The logical expression follows a Python-like syntax: `MatchSpec` strings MAY be joined with operators `and` (logical AND) and `or` (logical OR), and grouped within parentheses `()` for precedence overrides. | ||
|
|
||
| The inner `MatchSpec` queries inside `when` MUST be expressed in their square brackets syntax, with the exception of simple `name` and `version` queries that MAY be expressed as `{name}{operator}{version}` (no space separators). These inner `MatchSpec` queries MUST NOT feature their own `when` field. |
There was a problem hiding this comment.
@chenghlee your scope-restriction concern from #111 (comment) didn't carry over when this CEP got split out. That thread is still unresolved (baszalmstra asked for concrete ambiguous cases, and jaimergp's follow-up on whether {name}{operator}{version} covers forms like python>=3,<4 is open too). Since voting is happening this week, could you re-raise or close it out on this PR?
There was a problem hiding this comment.
We asked Cheng about examples and he didn't reply :( We think the parser works fine, and we have tests for a number of edge cases.
There was a problem hiding this comment.
@jezdez I'm sorry my comment read passive-aggressive, it was not meant that way! We have already written a parser for this that works by quoting and escaping values. We didn't run into any difficult cases. I was asking about edge cases @chenghlee had in mind because I was curious whether there are difficult cases we missed. Since we didn't receive any during the RFC period, we felt it was fine to call a vote regardless.
There was a problem hiding this comment.
Sorry; got caught up in other things. I'm okay with my comment on the previous CEP being unresolved; it's mostly that strictly speaking, the current square bracket notation supports ridiculous (but semantically meaningless) things like [and=or foo="(123|4)" and 1], but having thought about it, I think the proper fix is to clamp down on allowable expressions in square brackets than to block this CEP.
|
@jaimergp I have concerns about this vote being called if the thread above wasn't closed, you even asked about it? |
|
It's a minor clarification, I'd say. |
|
Mid voting period reminder, @msarahan @marcelotrevisani @jakirkham @mariusvniekerk @chenghlee @pavelzw |
|
@mbargull @jakirkham last reminder to vote! |
|
I think the examples in this CEP are confusing, we aren't expecting users installing packages to really be specifying conditional dependencies, are we? I think the target audience for this feature would be package authors if I understand correctly. I guess the framing here is that the same MatchSpec is used by both user types, but I'm not sure if that's by necessity or just incidental. |
Vote results🗳️ The votes are in! Here is the tally for this @conda/steering-council vote. Thanks to everyone who participated. 🎉 Result: PASSED Summary
Abstentions count toward quorum but are excluded from the approval fraction. Tally
|
|
@benmoss, yes and no. I expect way more users on the packaging side (authoring recipes) then on the CLI (typing |
Checklist for submitter
cep-0000.mdnamedcep-XXXX.mdin the root level.CEP XX: Amend XYZ.## Changelogsection right above the final "Copyright" section with an item that uses syntaxYYYY-MM-DD: Brief explanation of changes.Checklist for CEP approvals
${greatest-number-in-main} + 1.cep-XXXX.mdfile has been renamed accordingly.# CEP XXXX -header has been edited accordingly.pre-commitchecks are passing.Comes from #111