Skip to content

Support [workspace.dependencies] for inherited dependency versions #5945

Closed

Description

@baszalmstra

Context

In a monorepo, updating a common dependency (e.g. Python) across many packages currently requires hand-editing every pixi.toml to keep the MatchSpec consistent. Users have resorted to sed scripts to do this. This was raised in discussion #5940 by @GuillaumeQuenneville under "Inherited Dependency Versions".

Proposal

What the user writes

Root pixi.toml (workspace):

[workspace.dependencies]            # conda
numpy = "1.*"
boltons = { version = ">=24", channel = "conda-forge" }

Member pixi.toml:

# Build packages
[package.build]
backend = { name = "foo-build", workspace = true }

[package.host-dependencies]
cmake = { workspace = true }

[package.target.linux-64.run-dependencies]
numpy = { workspace = true }

Semantics

  • { workspace = true } is only valid if the workspace defines that name in the matching [workspace.dependencies] table. Otherwise it's an error, with the span pointing at the offending entry.
  • { workspace = false } is rejected (same convention pixi already uses for inheritable metadata fields).
  • Workspace tables only define defaults that members opt into. A member that doesn't write { workspace = true } keeps full control; there is no implicit inheritance.
  • Inheritance is allowed from package dependency tables:
    • [package.build.backend], [package.host-dependencies], [package.build-dependencies], [package.run-dependencies], [package.run-constraints], and their [package.target.<sel>.*] variants.
  • Inheritance does not apply to constraints or exclude-newer.

Overrides on the member side

The workspace entry is the base; the member's entry layers on top. The base version always wins — the member never restates or narrows it.

The member may layer any non-version attribute on top of the workspace base: channel, build, subdir, md5, sha256, url, path, git, branch, rev, tag, subdirectory. Restating version on the member is an error. Mixing a binary workspace spec with a source-style override (or vice-versa) is an error.

Future: conda extras

Once conda gains extras (matching the existing PyPI concept), workspace inheritance for conda will treat extras identically to PyPI: the workspace value and member value are unioned, while all other fields layer with the workspace as the base.

Source dependency paths

Relative path specs in [workspace.*-dependencies] are resolved relative to the workspace root, not the consuming member's directory. Resolution happens once on the workspace side before the spec is handed to members.

Tooling

  • pixi add <pkg> --workspace: writes the spec into the root [workspace.dependencies] (or the matching pypi/host/build table) and writes <pkg> = { workspace = true } into the current member.

Out of scope for v1 (follow-ups)

  • pixi upgrade / version-bump UX across workspace + members in a single command.
  • Conda extras (tracked separately; this design just reserves the behavior).

References

Activity

  1. self-assigned this
    on May 12, 2026
  2. ruben-arts commented on May 15, 2026

    @ruben-arts
    Contributor

    This proposal misses the definition of a "member". Are members, workspaces or packages?

    Edit: The "Member" is a package in the subdir of a workspace right now. Until we have a different way to do this.

  3. ruben-arts commented on May 15, 2026

    @ruben-arts
    Contributor

    It looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions