Skip to content

Support for repodata and MatchSpec for conditional / extra / flags #4089

@danyeaw

Description

@danyeaw

Hi All,

Background

There is a draft CEP to add support for the next evolution of Repodata and MatchSpec. This proposal makes the following changes:

  1. Extra (optional) dependency sets that can be activated by the user or other packages
  2. Conditional dependencies to be activated on a specific platform, or when other package versions are also pulled in (for example requiring importlib_metadata; if python <3.10)
  3. Flags to make it easier to select variants confidently (instead of globbing the build string)

Why this is needed

Although this would be a nice update for the conda ecosystem in general, we are also interested in this for the conda CLI for better integration with the PyPI ecosystem. Having support for at least conditional dependencies is a prerequisite to adding wheels to repodata. We discussed more about that in our recent roadmap post.

While we work towards getting the CEP across the finish line, it would be great to start to support this in mamba as well. Is mamba interested in supporting these features so that we could make use of them in the conda-libmamba-solver?

Scope of Changes

From my naive review of the codebase, the main changes needed would be in:

  • libmamba/include/mamba/specs/repo_data.hpp - Add extras and flags fields
  • libmamba/src/solver/libsolv/helpers.cpp - Parse conditional syntax and evaluate conditions
  • libmamba/src/specs/match_spec.cpp - Support extras and flag syntax in MatchSpec
  • Solver integration - Handle conditional deps and extras during resolution

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions