prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
3.02k stars 166 forks source link

Nested features - features in features #1534

Open PanTheDev opened 3 months ago

PanTheDev commented 3 months ago

Problem description

As the title says, I think it would be very convenient to allow features to contain other features.

My use case:

I maintain a python monorepo for ~15 developers. Some devs are on machines with an Nvidia GPU, others aren't. Since it's a monorepo, features come in handy to group common stuff. With CI/CD, environments get comes and use many features. To accommodate the devs without gpus, or to release with and without gpus support, I thus have duplicate environments which differ by only one feature, the one containing either the cuda or the non-cuda version of pytorch. Thus, I have to create envs with ~8 of the same features, and the appropriate pytorch feature.

I'm sure there are other similar use cases.

What I propose:

The features table could have a key include which would be an array of features, the same as for the environments feature key.

Included features would merely add their I dependencies and pypi-dependencies to the main feature, like the union of two sets.

When there are duplicate dependencies, the parent feature's dependency takes precedence.

Features included in multiple environments are completely distinct. They do not act as a solve-group.

Features can be arbitrarily nested.

I'm eager to hear everyone's thoughts on this 😊

tdejager commented 3 months ago

Interesting! Let's wait for more people to chime in!

akhmerov commented 3 months ago

The problem looks related to #1519