pixi icon indicating copy to clipboard operation
pixi copied to clipboard

`pixi --strict` mode

Open nichtmacho opened this issue 2 years ago • 4 comments

Problem description

Having this pixi.toml as an example:

[environments]
default = { features = ["py312"], solve-group = "py312" }
py312 = { features = ["py312"], solve-group = "py312" }
py311 = ["py311"]
py310 = ["py310"]
py39 = ["py38"]
py38 = ["py38"]

and executing pixi run or pixi install I will receive the following error: WARN The feature 'py39' is defined but not used in any environment which is totally fine.

My suggestion is to introduce a sort of strict mode for pixi, which will error when the feature is not used in any environment, which will help to catch these typos.

nichtmacho avatar Jul 26 '24 14:07 nichtmacho

I think we should be conservative when adding new options. However, maybe we could just error here?

Hofer-Julian avatar Jul 26 '24 14:07 Hofer-Julian

good point - but I think it could be a potential breaking change for users that have unused features, and after running pixi self-update or having setup-pixi: latest CI will receive some red pipelines

nichtmacho avatar Jul 26 '24 14:07 nichtmacho

Optional dependencies in pyproject.toml are interpreted as features. There are likely situations where not having an environment for each feature is desired. So defaulting to erroring could be an issue I think?

I feel like the current warning is a good middle ground for most use cases. A strict mode / check command may help in some other situations

olivier-lacroix avatar Jul 27 '24 00:07 olivier-lacroix

I rather have something like pixi lint to error on non functional warning level feedback. This issue is not big enough to keep open for me. If there are more concrete ideas on how to fix this on a bigger level please open a new Issue.

ruben-arts avatar Aug 05 '24 13:08 ruben-arts