We have discussed (@baszalmstra and me) how to design a pixi-native when (in the context of supporting v3 repodata that includes conditional dependencies). This is especially relevant for pixi-build.
CEP: conda/ceps#164
In the raw matchspec, when can look something like:
foobar [when="python >=3.10"]
foobar [when="python and numpy"]
foobar [when="python or nodejs"]
Where the individual elements fo the expression can be full blown matchspecs again (except nested when is not allowed!).
For a Pixi / TOML native version, we came up with the following idea:
Allow single name, e.g:
foobar = { version = "*", when = "python" }
For more complex matchspec:
foobar = { version = "*", when = { python = ">3.10" } }
To support and / or:
# We use an array, and combine with AND by default (can be made explicit)
foobar = { version = "*", when = [{ python = ">3.10" }, "numpy" ] }
foobar = { version = "*", when = [{ python = ">3.10" }, { numpy = ">2"}] }
foobar = { version = "*", when = [{ python = ">3.10" }, "&&", { numpy = ">2"}] }
# for OR
foobar = { version = "*", when = [{ python = ">3.10" }, "||", { numpy = ">2"}] }
We have discussed (@baszalmstra and me) how to design a pixi-native
when(in the context of supporting v3 repodata that includes conditional dependencies). This is especially relevant forpixi-build.CEP: conda/ceps#164
In the raw matchspec, when can look something like:
Where the individual elements fo the expression can be full blown matchspecs again (except nested when is not allowed!).
For a Pixi / TOML native version, we came up with the following idea:
Allow single name, e.g:
For more complex matchspec:
To support and / or: