Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for meta.yaml selectors #4

Open
mariusvniekerk opened this issue Jul 22, 2020 · 0 comments
Open

Proposal for meta.yaml selectors #4

mariusvniekerk opened this issue Jul 22, 2020 · 0 comments

Comments

@mariusvniekerk
Copy link

mariusvniekerk commented Jul 22, 2020

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

- 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] 

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

No branches or pull requests

1 participant