In the proposed new meta.yaml specification (circa 2020-07) selectors are currently handled with the following construct
- sel(condition): entry
which supercedes the legacy form
- entry # [condition]
This is a somewhat atypical (but valid) construction as it causes keys to contain punctuation and would potentially force these keys to be quoted in the case of complex conditions.
Inspired by some of the other yaml centric config systems like ansible, I propose the following system
- select: entry
when: condition
This also opens up the concept of potentially specifying requirements as a full matchspec.
For example if we want to link to the non-gpl version of libreadline (actually libedit) we could specify the following
- req: libreadline
version: ">=7"
channel: conda-forge
license_family: bsd
# may as well support the conditional here
when: condition
Alternative stylings
Full python style:
rather than modelled on ansible we could basically just do something python-like
```yaml
- select:
- if: condition
value: a
- elif: condition
value: b
- else:
value
```
This has the advantage of nearly dealing with something like
```
- rust =1 # [win or osx]
- rust >=1 # [linux]
```
In the proposed new meta.yaml specification (circa 2020-07) selectors are currently handled with the following construct
which supercedes the legacy form
This is a somewhat atypical (but valid) construction as it causes keys to contain punctuation and would potentially force these keys to be quoted in the case of complex conditions.
Inspired by some of the other yaml centric config systems like
ansible
, I propose the following systemThis also opens up the concept of potentially specifying requirements as a full matchspec.
For example if we want to link to the non-gpl version of libreadline (actually libedit) we could specify the following
Alternative stylings
Full python style: rather than modelled on ansible we could basically just do something python-like ```yaml - select: - if: condition value: a - elif: condition value: b - else: value ``` This has the advantage of nearly dealing with something like ``` - rust =1 # [win or osx] - rust >=1 # [linux] ```