Skip to content

Commit

Permalink
feat: solve groups for conda (prefix-dev#783)
Browse files Browse the repository at this point in the history
Co-authored-by: Ruben Arts <[email protected]>
  • Loading branch information
baszalmstra and ruben-arts authored Feb 7, 2024
1 parent 875159b commit a9f1f61
Show file tree
Hide file tree
Showing 15 changed files with 2,857 additions and 98 deletions.
2 changes: 2 additions & 0 deletions examples/solve-groups/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML
2 changes: 2 additions & 0 deletions examples/solve-groups/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# pixi environments
.pixi
1,749 changes: 1,749 additions & 0 deletions examples/solve-groups/pixi.lock

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions examples/solve-groups/pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[project]
name = "solve-groups"
version = "0.1.0"
description = "Add a short description here"
authors = ["Bas Zalmstra <[email protected]>"]
channels = ["conda-forge"]
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]

[feature.max_py310.dependencies]
python = "<=3.10"
pydantic = "*"

[feature.min_py38.dependencies]
python = ">=3.8"
py-rattler = "*"

[environments]
# The solve-group mixes the dependencies of all features in the group and solves them together.
# Both environments should have at most python 3.10, even though `min-py38` environment only
# specifies a lower bound.
#
# The environments do not contain any dependencies from the other environments. This means that
# the `min-py38` environment does not contain `pydantic` and the `max-py310` environment does not
# contain `py-rattler`.
min-py38 = { features = ["min_py38"], solve-group = "group1" }
max-py310 = { features = ["max_py310"], solve-group = "group1" }

# The default environment does not specify a solve-group which means the python version does not
# have an upperbound.
default = ["min_py38"]
4 changes: 3 additions & 1 deletion src/cli/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ pub async fn execute(args: Args) -> miette::Result<()> {
.features(true)
.map(|feature| feature.name.clone())
.collect(),
solve_group: env.manifest().solve_group.clone(),
solve_group: env
.solve_group()
.map(|solve_group| solve_group.name().to_string()),
environment_size: None,
dependencies: env
.dependencies(None, Some(Platform::current()))
Expand Down
Loading

0 comments on commit a9f1f61

Please sign in to comment.