refactor: move PyPI resolution and installation into the command dispatcher#6324
Open
wolfv wants to merge 3 commits into
Open
refactor: move PyPI resolution and installation into the command dispatcher#6324wolfv wants to merge 3 commits into
wolfv wants to merge 3 commits into
Conversation
Add an install-pypi operation to the CommandDispatcher so that PyPI packages can be installed into a conda prefix through the same handle that already drives conda solves and installs. This makes the PyPI install pipeline reusable outside the workspace install path, e.g. for pixi global. - Extract UvReporter/UvReporterOptions into a new pixi_uv_reporter crate. pixi_reporters depends on pixi_command_dispatcher, so the reporter had to move below the dispatcher to let it depend on pixi_install_pypi without a cycle. pixi_reporters re-exports the types so existing users are unaffected. - Add InstallPypiEnvironmentSpec and CommandDispatcher::install_pypi_environment, which wraps PyPIEnvironmentUpdater and derives the wheel link mode from the dispatcher's configured link options. - Switch the workspace install path in pixi_core to build the spec and go through the dispatcher instead of wiring up the updater configs inline.
Complete the PyPI refactor started with install: resolution now also runs through the CommandDispatcher, so both halves of the PyPI story (solve + install) are reachable outside the workspace code, e.g. for pixi global. - Move the resolve pipeline (resolve_pypi, LazyBuildDispatch, CondaResolverProvider) from pixi_core::lock_file::resolve into pixi_install_pypi::resolve. - Decouple it from the workspace with a new CondaPrefixProvider trait: when uv must build an sdist to get metadata, the provider supplies a conda prefix (python interpreter + activation env vars) on demand. pixi_core implements it as WorkspaceCondaPrefixProvider wrapping the memoized CondaPrefixUpdater and environment activation; both the lock-file update path and the satisfiability metadata checks use it. - Move PypiPackageIdentifier into pixi_install_pypi; the satisfiability-specific satisfies() check stays in pixi_core as an extension trait. - Add SolvePypiEnvironmentSpec and CommandDispatcher::solve_pypi_environment, deriving the link mode from the dispatcher's configured link options. - Drop the dead conda_task plumbing: LazyBuildDispatch::conda_task was never assigned, so resolve_pypi now returns just the locked records and the PypiGroupSolved task keeps forwarding None. - Remove the uv-* dependencies pixi_core no longer needs.
rattler_digest and uv-preview were only used by the PyPI resolve code that moved to pixi_install_pypi.
b09716a to
247b0d6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors the PyPI resolution and installation pipelines to be driven through the
CommandDispatcher, mirroring the existing architecture for conda package management. The changes improve separation of concerns and enable better code reuse across different pixi entry points (workspace, global, etc.).Key changes:
New command dispatcher modules:
solve_pypi.rs: Drives PyPI dependency resolution throughSolvePypiEnvironmentSpecinstall_pypi.rs: Drives PyPI package installation throughInstallPypiEnvironmentSpecExtracted shared code:
PypiPackageIdentifierfrompixi_coretopixi_install_pypifor reuse across the codebasepixi_uv_reportercrate to share uv progress reporting logic (previously inpixi_reporters)CondaPrefixProvidertrait and related types topixi_install_pypi::resolvefor workspace-agnostic resolutionWorkspace-side resolution support:
WorkspaceCondaPrefixProviderinpixi_corethat implements theCondaPrefixProvidertraitLazyBuildDispatchimplementationSimplified PyPI update flow:
InstallPypiEnvironmentSpecstructpixi_install_pypiconfiguration types frompixi_coreImproved module organization:
How Has This Been Tested?
Existing test suites should validate the refactoring:
solve_pypi_environmentandinstall_pypi_environmentmethodsChecklist:
https://claude.ai/code/session_01S4nY8g4frki9JvtuUnZm85