Repository navigation
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
21f76ed to
25e2c80
Compare
6ffddc1 to
bc03bce
Compare
bc03bce to
6b1dd36
Compare
| if let Some(members) = lock.member_group_metadata() { | ||
| let group_root = target.group_root(groups); |
There was a problem hiding this comment.
[P1] Reuse the public lockfile requirement API
group_root and the includes_group calls below access private methods defined in the sibling install_target module. Rust rejects these calls with E0624, preventing ordinary uv builds because uv-cli-project is now an unconditional dependency. Reuse InstallTarget::python_requirement, with a consistent requirement type, instead of duplicating its implementation here.
| .arg("--offline") | ||
| .arg("--no-cache") | ||
| .env("RUST_LOG", "uv_lock_operations::validated_lock=debug"), @" | ||
| .env("RUST_LOG", "uv_cli_project::lock=debug"), @" |
There was a problem hiding this comment.
[P2] Keep the tracing filter aligned with the executed validator
The lock command still uses uv_lock_operations::ValidatedLock, whose debug event originates in uv_lock_operations::validated_lock. This filter excludes that event, so both modified tests lose the debug line required by their snapshots when test-universal is enabled. Retain the original filter until the actual command uses the new validator.
| uv-cli-common = { workspace = true } | ||
| uv-cli-operations = { workspace = true } | ||
| uv-cli-project = { workspace = true } | ||
| uv-cli-tool = { workspace = true } |
There was a problem hiding this comment.
[P3] Complete the migration before adding a duplicate command stack
No production Rust caller outside these four crates references them: the dispatcher still aliases uv_tool_commands and uv_project_commands, and shared types still come from uv_command_support and uv_settings. Consequently, this adds roughly 17,000 lines of parallel implementations while integration tests continue exercising the original stack. Remove the unused copies, or migrate the callers and remove the superseded implementations together, so subsequent fixes have one authoritative location.
6b1dd36 to
6516d69
Compare
|
|
||
| anyhow = { workspace = true } | ||
| fs-err = { workspace = true } | ||
| insta = { workspace = true } |
There was a problem hiding this comment.
[P3] Keep insta in dev-dependencies
The only insta use is inside the #[cfg(test)] module in operations.rs, but this declaration pulls snapshot-testing machinery into uv's normal dependency graph. The original uv-install-operations correctly declares it under [dev-dependencies]. Keep that separation in the new crate.
| let has_editable = requirements | ||
| .iter() | ||
| .any(|source| matches!(source, RequirementsSource::Editable(_))); | ||
| return Err(anyhow::Error::new(ExtrasWithoutSourceError { has_editable }).into()); |
There was a problem hiding this comment.
[P3] Retain the typed extras validation error
This erases a known error into anyhow, requiring Error::hints to search and downcast the error chain to recover ExtrasWithoutSourceError. The existing resolver represents this as Error::ExtrasWithoutSource { has_editable } and selects its hint directly. Retain that variant in the new error enum to avoid introducing runtime type recovery during the crate split.
| } | ||
| } | ||
|
|
||
| if python_preference.allows_source(PythonSource::DiscoveredEnvironment) { |
There was a problem hiding this comment.
[P2] Preserve interpreter-aware Python preference validation
allows_source(DiscoveredEnvironment) always returns true, so the extracted project/script workflow accepts an existing managed environment under --no-managed-python, and an unmanaged environment under --managed-python. The original compatibility check uses PythonInstallation::satisfies_preference to inspect the interpreter; sync_python_preference already covers this invariant. Retain that interpreter-aware check during the extraction.
| async fn from_request( | ||
| python_request: Option<PythonRequest>, | ||
| workspace: Option<&Workspace>, | ||
| script: Pep723ItemRef<'_>, | ||
| config_discovery: ConfigDiscovery, |
There was a problem hiding this comment.
[P3] Keep script selection free of unused workspace support
The sole caller of this private function explicitly passes workspace = None. Nevertheless, the extraction introduces workspace requirements, discovery boundaries, a RequiresPythonSource enum, and a separate project-validation branch that cannot execute. This adds unsupported paths to maintain when changing script selection. Keep the original workspace-free selector and introduce workspace support alongside a concrete consumer.
| pub fn read_env_files(env_files: &[PathBuf]) -> anyhow::Result<Vec<(String, String)>> { | ||
| let mut environment = Vec::new(); | ||
|
|
||
| for env_file_path in env_files.iter().rev().map(PathBuf::as_path) { |
There was a problem hiding this comment.
[P3] Keep one dotenv reader within uv-cli-common
The new env_file.rs contains an identical read_env_files implementation, and the extracted tool runner already imports that version. Keeping this public copy creates two implementations of dotenv precedence and parse-error handling within the same crate. Remove the copy from child.rs, or re-export the single implementation if both module paths are needed.
Tool commands and shared project workflows live alongside the dispatcher in
uv. Move tool command handlers intouv-cli-tool, project environment and lock workflows intouv-cli-project, shared resolution and installation operations intouv-cli-operations, and shared CLI types and output intouv-cli-common.Selected dependencies (
A -> BmeansAusesB):uv-cli-operationsserves pip, project, and tool commands.uv-cli-projectmanages project environments, synchronization, lock validation, and audit support. Pip and project command handlers remain inuv.