meta.yaml: how to require one from a list of packages

Viewed 26

Is there a way to code a requirements section in a meta.yaml file where any one package from a list of choices will satisfy the requirement? This is where different packages provide the same needed capability and there is no reason to specify a particular choice.

In my case the conda svn package and the conga-forge subversion package provide the same tool and either is fine, but an analogous case would be where either PIL or Pillow would be required so I want to have something like:

requirements:
  run:
    - python>=3.7
    - pil or pillow

Is this possible?

1 Answers

The closest thing to this is build variants. This would entail issuing a separate build for each variant. Setting aside that the example here is contrived (pil is outdated and only available for Python 2.7 on Conda), but it'd be something

conda_build_config.yaml

pil_variant:
  - pil
  - pillow

meta.yaml

requirements:
  run:
    - python>=3.7
    - {{ pil_variant }}
Related