Skip to content

Extract project commands into uv-project-commands - #22199

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/codex-uv-stack-12-project
Oct 7, 2026
Merged

charliermarsh merged 1 commit into
mainfrom
charlie/codex-uv-stack-12-project

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

We move project command implementations into uv-project-commands, including uv init for projects and scripts. Initialization stays with the commands that manage those projects and scripts, such as add, lock, sync, and run.

The command implementations use the shared lock, environment, and audit workflows. The uv crate keeps process initialization, command dispatch, top-level diagnostics, and the remaining commands.

When uv version --frozen is used without a version change, we read the lockfile directly. That path needs no resolver settings, client, or resolution state.

Crate structure

Selected dependencies after the complete split:

uv (process initialization, dispatch, remaining commands)
|
+-- uv-cli (argument parsing and settings resolution)
+-- uv-python-commands -------> uv-python-context
+-- uv-pip-commands ----------> uv-{resolve,install}-operations
+-- uv-project-commands ------> uv-{lock,environment,audit}-operations
|   (including init)
+-- uv-workspace-commands ----> uv-{lock,environment}-operations
+-- uv-tool-commands ---------> uv-{lock,environment,audit}-operations
+-- uv-build-commands --------> uv-build-frontend, uv-dispatch, uv-python-context
`-- uv-publish-commands ------> uv-publish

uv-lock-operations ----------> uv-resolve-operations
uv-environment-operations ---> uv-{resolve,install}-operations
                          `--> uv-python-context

Benchmarks

We split command families and shared workflows so local edits can reuse more compiled code and rebuild faster.

We replayed these historical production changes on the stack’s base (822539467) and final layout (129123230). Times are medians of three paired development-binary rebuilds, including linking, on Linux with stock Rust 1.99.0 and 16 Cargo jobs. Each replay starts from a warmed before-state. The comparison covers the full stack, including its prerequisite refactors.

Historical change Before After Reduction
Project add: empty metadata cache 12.25s 8.39s 31.5%
Project sync: workspace warning 12.07s 6.92s 42.7%
CLI/settings: audit group selection 14.44s 8.95s 38.0%
Install operations: dry-run distributions 14.18s 9.40s 33.7%
Lock metadata API and workspace command 16.74s 11.67s 30.3%
Lock internals: conflicting groups 22.21s 14.41s 35.1%
Python installation type and command 43.11s 29.37s 31.9%

Lower wall times can require more total CPU; gains depend on available parallelism.

@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from 4592bcf to cfb0212 Compare October 5, 2026 15:13
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from cfb0212 to 032ea99 Compare October 5, 2026 16:21
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from 032ea99 to c5d2c39 Compare October 5, 2026 17:14
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from c5d2c39 to 4990cd4 Compare October 5, 2026 17:34
@charliermarsh charliermarsh added the internal A refactor or improvement that is not user-facing label Oct 5, 2026
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from 4990cd4 to add3d95 Compare October 5, 2026 18:39
@charliermarsh
charliermarsh changed the base branch from charlie/codex-uv-stack-11-workspace to charlie/codex-uv-stack-package-selection October 5, 2026 18:39
@charliermarsh
charliermarsh added this pull request to stack #22200 October 5, 2026 18:52
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from add3d95 to f012cca Compare October 5, 2026 18:56
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from f012cca to 2a89a1b Compare October 5, 2026 20:10
Base automatically changed from charlie/codex-uv-stack-package-selection to charlie/codex-uv-stack-11-workspace October 5, 2026 20:10
@charliermarsh
charliermarsh removed this pull request from stack #22200 October 5, 2026 20:13
@charliermarsh
charliermarsh added this pull request to stack #22209 October 5, 2026 20:15
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from 2a89a1b to 3f24e44 Compare October 5, 2026 20:38
@charliermarsh
charliermarsh removed this pull request from stack #22222 October 6, 2026 00:18
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from c2026b1 to c5e6909 Compare October 6, 2026 00:18
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from c5e6909 to 1f9eb2b Compare October 6, 2026 00:46
@charliermarsh
charliermarsh added this pull request to stack #22228 October 6, 2026 00:48
@charliermarsh
charliermarsh removed this pull request from stack #22228 October 6, 2026 00:56
@charliermarsh
charliermarsh added this pull request to stack #22230 October 6, 2026 00:57
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from 1f9eb2b to 0866d0b Compare October 6, 2026 16:49
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from 0866d0b to 8c1b774 Compare October 6, 2026 16:54
@charliermarsh
charliermarsh removed this pull request from stack #22230 October 6, 2026 17:21
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from 8c1b774 to f3c03eb Compare October 6, 2026 17:21
@charliermarsh
charliermarsh added this pull request to stack #22254 October 6, 2026 17:22
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from f3c03eb to 5a11d7c Compare October 6, 2026 17:47
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from 5a11d7c to 36d044b Compare October 6, 2026 18:02
@charliermarsh
charliermarsh force-pushed the charlie/codex-uv-stack-12-project branch from 36d044b to 7c10002 Compare October 6, 2026 20:48

This branch was previously deployed

1 inactive deployment
automations — 08ceae67 Deployed Oct 7, 2026 by charliermarsh via review / security review #49971
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant