uv
45c271d1 - Automatically detect workspace packages in `uv add` (#4557)

Commit
1 year ago
Automatically detect workspace packages in `uv add` (#4557) ## Summary If the package _isn't_ marked as `workspace = true`, locking will fail given: ```rust let workspace_package_declared = // We require that when you use a package that's part of the workspace, ... !workspace.packages().contains_key(&requirement.name) // ... it must be declared as a workspace dependency (`workspace = true`), ... || matches!( source, Some(Source::Workspace { // By using toml, we technically support `workspace = false`. workspace: true, .. }) ) // ... except for recursive self-inclusion (extras that activate other extras), e.g. // `framework[machine_learning]` depends on `framework[cuda]`. || &requirement.name == project_name; if !workspace_package_declared { return Err(LoweringError::UndeclaredWorkspacePackage); } ``` Closes https://github.com/astral-sh/uv/issues/4552.
Author
Parents
Loading