astral-sh/uv · error

Workspace does not contain any buildable packages. For examp

Error message

Workspace does not contain any buildable packages. For example, to build `{}` with `{}`, add a `{}` to `{}`:
```toml
[build-system]
requires = ["uv_build>={min_version},<{max_version}"]
build-backend = "uv_build"
```

What it means

`uv build --all-packages` found workspace members, but after filtering with pyproject_toml().is_package(true) zero remain — every member lacks a `[build-system]`, so none is buildable. The error prints the first member and a uv_build `[build-system]` snippet pinned to the running uv version range. Note the code uses .next().unwrap() on the non-empty packages map, which is safe here because error 75 already guaranteed non-emptiness.

Source

Thrown at crates/uv/src/commands/build_frontend.rs:423

        if workspace.packages().is_empty() {
            return Err(anyhow::anyhow!("No packages found in workspace"));
        }

        let packages: Vec<_> = workspace
            .packages()
            .values()
            .filter(|package| package.pyproject_toml().is_package(true))
            .map(|package| AnnotatedSource {
                source: Source::Directory(Cow::Borrowed(package.root())),
                package: Some(package.project().name.clone()),
            })
            .collect();

        if packages.is_empty() {
            let member = workspace.packages().values().next().unwrap();
            let name = &member.project().name;
            let pyproject_toml = member.root().join("pyproject.toml");
            return Err(anyhow::anyhow!(
                "Workspace does not contain any buildable packages. For example, to build `{}` with `{}`, add a `{}` to `{}`:\n```toml\n[build-system]\nrequires = [\"uv_build>={min_version},<{max_version}\"]\nbuild-backend = \"uv_build\"\n```",
                name.cyan(),
                "uv_build".cyan(),
                "build-system".green(),
                pyproject_toml.user_display().cyan()
            ));
        }

        packages
    } else {
        vec![AnnotatedSource::from(src)]
    };

    // Build backends can include arbitrary files from the source directory in the distribution.
    // Warn if the active cache is within the source since cache contents may be included in the
    // build.
    for source in &packages {
        if let Source::Directory(source_dir) = &source.source

View on GitHub (pinned to f1a42680ff)

Solutions

  1. Add the `[build-system]` table (snippet in the message) to each member you want built.
  2. If only some members should build, build them explicitly with `--package <name>` instead of --all-packages.
  3. Move non-buildable utility members out of the workspace or keep them virtual and stop using --all-packages.

Example fix

# before: packages/a/pyproject.toml (no build-system)
# after
[build-system]
requires = ["uv_build>=0.8,<0.9"]
build-backend = "uv_build"

# then: uv build --all-packages
Defensive patterns

Strategy: validation

Validate before calling

# Rust: pre-filter buildable members and fail with a clear list
let buildable: Vec<_> = workspace.packages().values()
    .filter(|p| p.pyproject_toml().is_package(true))
    .collect();
anyhow::ensure!(
    !buildable.is_empty(),
    "no member has [build-system]; add it to at least one of: {:?}",
    workspace.packages().keys().collect::<Vec<_>>()
);

Type guard

fn has_build_system(pkg: &WorkspacePackage) -> bool {
    pkg.pyproject_toml().is_package(true)
}

Prevention

When it happens

Trigger: A workspace of virtual/utility members (only `[project]`, no `[build-system]`) run with `--all-packages`; all real packages excluded from the workspace while virtual ones remain.

Common situations: Monorepos where several members are metadata-only; migrating a repo to uv where build-system tables were optional under the old tooling.

Related errors


AI-assisted analysis of astral-sh/uv@f1a42680ff (2026-08-16). Data as JSON: /api/errors/925e241a6be2bd73. Report an issue: GitHub.