support dependency groups
I think this is a very convenient feature that pdm and poetry has. When I try to make a package that may use CUDA, I need to have a dependency that depends on hardware configurations, and a package manager has no means to know that thus I believe the best way is to let users decide which group of dependencies they should install. This is like the features at the package level.
Currently, there is no way to specify both CPU and GPU dependencies with rye within one pyproject.toml, cargo also has something similar that allows one to specify dependencies based on the current crates' features. And I don't see a way of passing "extra"s in python's pyproject.toml (e.g pass the extra [cuda12] across packages) I hope this could be something rye can fix
It also would be great to be able to build wheels by specifying dependency groups. I want to build a CPU version of my package that uses the CPU version of pytorch, and another that uses the GPU version and also installs a few other packages. poetry doesn't support this even though it has dependency groups.
Came here to say it would be nice to see this feature. Although I'm a bit confused as to what do we mean by dependency groups.
- Python projects already have a way of specifying extras under
[project.optional-dependencies]inpyproject.toml. Is this what we are referring to? - There's also a draft PEP-735 which is also called dependency groups. Although this talks about adding a top level
[dependency-groups]table inpyproject.toml, amongst other things.
If we're referring to extras, I think rye already supports them. To add flask as an extra under the group web,
rye add flask --optional web
To add flask[async] as an extra / optional dependency under the group web,
rye add flask --features async --optional web
What's confusing is that if you need to do rye sync with the web extra included, you use --features instead of --optional.
rye sync --features web