Open
Description
Problem
In uv, we have a number of crates in a crates/
directory, and this root Cargo.toml to go with it:
[workspace]
members = ["crates/*"]
exclude = [
"scripts",
# Needs nightly
"crates/uv-trampoline",
]
resolver = "2"
Since we're a python build tool, we sometimes have to clone repositories that contain a Cargo.toml
on their own, e.g.
cargo run pip install deptry --no-binary deptry --cache-dir foo
or, for a minimal example:
mkdir bar && cd bar && git clone https://github.com/fpgmaas/deptry && cd deptry && cargo check
The build of deptry fails:
error: current package believes it's in a workspace when it's not:
current: /home/konsti/projects/uv/bar/deptry/Cargo.toml
workspace: /home/konsti/projects/uv/Cargo.toml
this may be fixable by adding `bar/deptry` to the `workspace.members` array of the manifest located at: /home/konsti/projects/uv/Cargo.toml
Alternatively, to keep it out of the workspace, add the package to the `workspace.exclude` array, or add an empty `[workspace]` table to the package's manifest.
I can add foo
or bar
to workspace.exclude
, but i would like to exclude all directories that aren't crates
. I tried *
, **
, **/*
, ./*
, ./**
and ./**/*
to no avail. "./"
works but removes all members from the workspace.
Proposed Solution
A switch to exclude all non-member packages from the workspace.
Notes
No response