From d7b059b079cd8407a5ee7b40ac843b09d01c5800 Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Thu, 21 Dec 2023 13:28:47 +0100 Subject: [PATCH] remove `default-features` field from the environments --- .../multi_environment_proposal.md | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/docs/design_proposals/multi_environment_proposal.md b/docs/design_proposals/multi_environment_proposal.md index ee7af9471..0e6b73211 100644 --- a/docs/design_proposals/multi_environment_proposal.md +++ b/docs/design_proposals/multi_environment_proposal.md @@ -92,14 +92,11 @@ The environment definition should contain the following fields: - `features: Vec`: The features that are included in the environment set, which is also the default field in the environments. - `environments: Vec`: The environments that are included in the environment set. When environments is used, the extra features are **on top** of the included environments. Environments are used as a locked base, so the features added to an environment are not allowed to change the locked set. This should result in a failure if the locked set is not compatible with the added features. -- `default-features: bool`: Whether the default features should be included in the environment set. ```toml [environments] -# `default` environment is now the `default` feature plus the py39 feature +# `default` environment is now the `default` feature plus the `py39` feature default = ["py39"] -# `lint` environment is now the `lint` feature without the `default` feature or environment -lint = {features = ["lint"], default-features = "false"} # `dev` environment is now the `default` feature plus the `test` feature, which makes the `default` envriroment is solved without the use of the test feature. dev = {environments = ["default"], features = ["test"]} ``` @@ -111,7 +108,6 @@ default = ["py39"] # implicit: default = ["py39", "default"] py310 = ["py310"] # implicit: py310 = ["py310", "default"] test = ["test"] # implicit: test = ["test", "default"] test39 = ["test", "py39"] # implicit: test39 = ["test", "py39", "default"] -lint = {features = ["lint"], default-features = "false"} # no implicit default ``` ```toml title="Creating environments from environments" linenums="1" @@ -121,6 +117,23 @@ prod = ["py39"] test_prod = {environments = ["prod"], features = ["test"]} ``` +```toml title="Creating environments without a default environment" linenums="1" +[dependencies] +# Keep empty or undefined to create an empty environment. + +[feature.base.dependencies] +python = "*" + +[feature.lint.dependencies] +pre-commit = "*" + +[environments] +# Create a custom default +default = ["base"] +# Create a custom environment which only has the `lint` feature as the default feature is empty. +lint = ["lint"] +``` + ### Lockfile Structure Within the `pixi.lock` file, a package may now include an additional `environments` field, specifying the environment to which it belongs. To avoid duplication the packages `environments` field may contain multiple environments so the lockfile is of minimal size.