Add support for tool.uv into distribution building (#3904)
With the change, we remove the special casing of workspace dependencies and resolve `tool.uv` for all git and directory distributions. This gives us support for non-editable workspace dependencies and path dependencies in other workspaces. It removes a lot of special casing around workspaces. These changes are the groundwork for supporting `tool.uv` with dynamic metadata. The basis for this change is moving `Requirement` from `distribution-types` to `pypi-types` and the lowering logic from `uv-requirements` to `uv-distribution`. This changes should be split out in separate PRs. I've included an example workspace `albatross-root-workspace2` where `bird-feeder` depends on `a` from another workspace `ab`. There's a bunch of failing tests and regressed error messages that still need fixing. It does fix the audited package count for the workspace tests.
This commit is contained in:
@@ -11,7 +11,7 @@ use uv_build::{SourceBuild, SourceBuildContext};
|
||||
use uv_cache::{Cache, CacheArgs};
|
||||
use uv_client::RegistryClientBuilder;
|
||||
use uv_configuration::{
|
||||
BuildKind, Concurrency, ConfigSettings, NoBinary, NoBuild, SetupPyStrategy,
|
||||
BuildKind, Concurrency, ConfigSettings, NoBinary, NoBuild, PreviewMode, SetupPyStrategy,
|
||||
};
|
||||
use uv_dispatch::BuildDispatch;
|
||||
use uv_interpreter::PythonEnvironment;
|
||||
@@ -80,6 +80,7 @@ pub(crate) async fn build(args: BuildArgs) -> Result<PathBuf> {
|
||||
&NoBuild::None,
|
||||
&NoBinary::None,
|
||||
concurrency,
|
||||
PreviewMode::Enabled,
|
||||
);
|
||||
|
||||
let builder = SourceBuild::setup(
|
||||
|
||||
@@ -20,7 +20,7 @@ struct ToolUv {
|
||||
#[serde(flatten)]
|
||||
options: Options,
|
||||
#[serde(flatten)]
|
||||
dep_spec: uv_requirements::pyproject::ToolUv,
|
||||
dep_spec: uv_distribution::pyproject::ToolUv,
|
||||
}
|
||||
|
||||
#[derive(clap::Args)]
|
||||
|
||||
Reference in New Issue
Block a user