-
Notifications
You must be signed in to change notification settings - Fork 387
Description
Description
Extras are part of a CEP (rendered) which is yet to be merged.
However, we already implemented it in rattler.
This issue proposes to implement extras support, so we will get capabilities to optional dependencies and dependency groups of PyPI.
Pixi packages could add extras like this:
[package]
name = "bas-package"
[package.dev-dependencies.test]
pytest = "*"
python = "*"
[package.extra-dependencies.arrow]
arrow = "*"Note that there are two keys: dev-dependencies and extra-dependencies.
If the package is part of your workspace, there's no difference, you can just enable both kind of extras like this:
[dependencies]
bas-package = { path = "./bas-package" , extras = ["test", "arrow"]}However, if the package comes from a channel, only extras specified in extra-dependencies are available:
[dependencies]
bas-package = { version = "*" , extras = ["arrow"]}That means, if you run pixi build, dev-dependencies are not taken into account.
Implementation
The information, which extras are activated need to be added to the environments, since the package metadata is unaffected by which extras are enabled.
environments:
defaults:
packages:
- conda: ./bas-package
extras: ["test", "arrow"]In the first iteration, we should also only allow extras to be enabled for source packages, since there are no channels around yet that support extras.