Skip to content

feat(pixi_spec): support extras, flags and when on conda dependencies#6262

Open
Hofer-Julian wants to merge 1 commit into
mainfrom
feat/pixi-spec-v3-fields
Open

feat(pixi_spec): support extras, flags and when on conda dependencies#6262
Hofer-Julian wants to merge 1 commit into
mainfrom
feat/pixi-spec-v3-fields

Conversation

@Hofer-Julian
Copy link
Copy Markdown
Contributor

@Hofer-Julian Hofer-Julian commented Jun 3, 2026

This enables extras, flags and when to work with source dependencies.
Also, recursive source dependencies work.

Example 1:

[dependencies]
example-rust = { path = ".", extras = ["wolf", "julian"]}

[package]
name = "example-rust"
version = "0.1.0"

[package.build]
backend = { name = "pixi-build-rust", version = "*"  }

[package.extra-dependencies.wolf]
rust = "*"
example-rattler-build = { path = "./recipe/recipe.yaml" }

[package.target.win-64.extra-dependencies.julian]
python = "*"

Example 2:

[dependencies]
example-rust = { path = ".", flags = ["cuda"] }

[package]
name = "example-rust"
version = "0.1.0"

[package.build]
backend = { name = "pixi-build-rust", version = "*"  }
flags = ["cuda", "blas_openblas"]

Example 3:

[dependencies]
example-rust = { path = "." }
python = "3.13"

[package]
name = "example-rust"
version = "0.1.0"

[package.build]
backend = { name = "pixi-build-rust", version = "*"  }

[package.run-dependencies]
numpy = { version = "*", when = { package = "python", version = ">=3.12" } }

Copy link
Copy Markdown
Contributor

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR merges some fundamental concepts.

Previously we had SourceLocationSpec which is just a reference to a source location. We renamed that to SourceSpec and added matchspec fields to the type. However, we also want to be able to refer to just the location, for instance when refering to where the manifest is or where the build source is. This now also always carries a matchspec which makes no sense in this context. I think we should split these concepts, have a SourceLocationSpec which refers to a location that we can checkout and where source is located, and a combination of a SourceLocationSpec and matchspec fields to refer to a specific package variant inside the source location.

Comment thread crates/pixi_spec/src/source_anchor.rs Outdated
Comment thread crates/pixi_spec/src/lib.rs Outdated
Comment thread crates/pixi_spec/src/lib.rs Outdated
Comment thread crates/pixi_spec/src/lib.rs Outdated
Comment thread crates/pixi_spec/src/lib.rs
Comment thread crates/pixi_command_dispatcher/src/build/pin_compatible.rs Outdated
Comment thread crates/pixi_spec/src/toml.rs Outdated
Comment thread docs/reference/pixi_manifest.md Outdated
Comment thread crates/pixi_command_dispatcher/src/keys/source_metadata.rs Outdated
Comment thread crates/pixi_command_dispatcher/src/keys/solve_pixi_environment.rs
@Hofer-Julian Hofer-Julian force-pushed the feat/pixi-spec-v3-fields branch 8 times, most recently from c5b6e35 to c49f753 Compare June 3, 2026 14:53
@Hofer-Julian Hofer-Julian requested a review from baszalmstra June 3, 2026 14:54
@Hofer-Julian Hofer-Julian force-pushed the feat/pixi-spec-v3-fields branch from c49f753 to 25d2f88 Compare June 3, 2026 14:55
Comment thread crates/pixi_spec/src/lib.rs Outdated
Comment thread crates/pixi_command_dispatcher/src/installed_source_hints.rs Outdated
Comment thread crates/pixi_command_dispatcher/src/installed_source_hints.rs Outdated
Comment thread crates/pixi_command_dispatcher/src/installed_source_hints.rs
Comment thread crates/pixi_command_dispatcher/src/installed_source_hints.rs Outdated
Comment thread crates/pixi_command_dispatcher/src/build/conversion.rs Outdated
Comment thread crates/pixi_command_dispatcher/src/keys/resolve_source_record.rs Outdated
Comment thread crates/pixi_command_dispatcher/src/keys/resolve_source_record.rs Outdated
Comment thread crates/pixi_core/src/lock_file/satisfiability/platform.rs Outdated
Comment thread crates/pixi_command_dispatcher/src/errors.rs Outdated
@Hofer-Julian Hofer-Julian force-pushed the feat/pixi-spec-v3-fields branch 5 times, most recently from dcdcd6a to 9102884 Compare June 5, 2026 12:22
Restructure PixiSpec into six explicit variants that separate source from binary locations, and embed matchspec selectors on the source variants so conda dependencies accept extras, flags and when. This is the plumbing and parsing that lets source and binary specs round-trip the repodata v3 fields.

Based on "fix: support conda extras for satisfiabily and solve groups (#6260)".
@Hofer-Julian Hofer-Julian force-pushed the feat/pixi-spec-v3-fields branch from 9102884 to cb295f4 Compare June 5, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants