Skip to content

feat(publish): publish every workspace package by default#6526

Draft
Hofer-Julian wants to merge 9 commits into
mainfrom
claude/pixi-multi-package-publish-boszbi
Draft

feat(publish): publish every workspace package by default#6526
Hofer-Julian wants to merge 9 commits into
mainfrom
claude/pixi-multi-package-publish-boszbi

Conversation

@Hofer-Julian

Copy link
Copy Markdown
Contributor

Description

pixi publish could previously only publish a single package — the one closest to the invocation directory. This PR makes it publish every package that belongs to the workspace, built and uploaded in dependency order. --path <dir> keeps the previous single-package behavior.

How packages are discovered (new crates/pixi_cli/src/publish/discovery.rs): graph reachability, seeded from the closest [package] manifest, path specs in [workspace.dependencies], and the dependencies of every environment (in the --target-platform view). From those seeds, path-based source dependencies are followed transitively through each package's build/host/run/extra dependencies via the build backend metadata (which the dispatcher caches, so the build phase doesn't pay for it twice). Only packages whose sources live inside the workspace root are published; external sources (git/url, or paths escaping the workspace root) are still built when required but skipped from upload with an informational note.

Failure semantics: all packages are built before anything is uploaded, so a build failure never leaves the channel with a partially published, version-skewed set. Uploads happen dependencies-first, so there is never a moment where a package is on the channel while its workspace run dependencies are missing. If an upload fails partway, re-running resumes via --skip-existing (on by default).

Behavior notes:

  • Running pixi publish at a pure [workspace] root (no [package]) used to fail with a backend error; it now publishes the workspace, and reports a helpful error if the workspace has no packages at all.
  • A root manifest with both [workspace] and [package] plus path dependencies now publishes those dependencies too. Previously only the root package was uploaded, which produced channels with unsatisfiable depends entries.
  • The deprecated pixi build wrapper forwards --path, so it inherits the same defaults.

Example against a workspace where the root manifest only references pkg_b, and pkg_b run-depends on pkg_a via a path spec:

$ pixi publish --target-dir ./out
🔍 Discovered 2 packages in the workspace
📋 Building 2 package(s):
  - pkg_a v0.1.0 [pyh4616a5c_0] (noarch)
  - pkg_b v0.2.0 [pyh4616a5c_0] (noarch)
...
✔ Successfully published 2 package(s) to directory ./out
  - pkg_a-0.1.0-pyh4616a5c_0.conda
  - pkg_b-0.2.0-pyh4616a5c_0.conda

How Has This Been Tested?

  • New integration tests in source_package_tests.rs using the in-memory passthrough backend:
    • workspace-wide publish discovers a package reachable only transitively (kit → cpp → core) and uploads all three;
    • --path <member> still publishes exactly one package;
    • a workspace without packages fails with a helpful error.
  • New unit tests for the topological ordering (dependencies-first, non-member edges ignored, cycle tolerance).
  • Manually verified end-to-end with a locally built pixi binary against real pixi-build-python workspaces: multi-package publish in dependency order, correct depends metadata in the built artifacts, --path single-package mode, invocation from inside a member directory, the classic single-package workspace (unreferenced root [package] still found via the closest-package seed), and the empty-workspace error.
  • cargo test -p pixi_cli --lib (91 passed) and cargo test -p pixi --test integration_rust source_package (34 passed).

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude Code

`pixi publish` currently can only publish one package. I think we can detect all packages
in a workspace these days, so it should be possible to build them in the necessary order
(like one depends on the other) and then publish them. Investigate if what I said is true
and implement if possible.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PpyoXrYLjQyo7tMEQUhFq9


Generated by Claude Code

`pixi publish` now discovers all packages that belong to the workspace
and builds and uploads them in dependency order, instead of operating
on a single package.

Packages are discovered by graph reachability: seeds are the closest
`[package]` manifest, the `[workspace.dependencies]` pool, and the
dependencies of every environment (in the target-platform view); from
there, path-based source dependencies are followed transitively through
each package's build, host, run, and extra dependencies via the build
backend metadata. Only packages whose sources live inside the workspace
root are published; external sources (git/url or paths escaping the
workspace) are still built when needed but skipped from upload with a
note.

All packages are built before anything is uploaded, so a build failure
never leaves the target channel with a partially published set. Uploads
happen dependencies-first, so the channel never contains a package
whose workspace run dependencies are missing. A failed upload can be
retried; `--skip-existing` (on by default) resumes where it stopped.

`--path <dir>` keeps the previous behavior of building and publishing
exactly one package.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpyoXrYLjQyo7tMEQUhFq9
@Hofer-Julian Hofer-Julian marked this pull request as draft July 6, 2026 07: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