-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
A-workspacesArea: workspacesArea: workspacesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-team-inputStatus: Needs input from team on whether/how to proceed.Status: Needs input from team on whether/how to proceed.
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
bluss
Metadata
Metadata
Assignees
Labels
A-workspacesArea: workspacesArea: workspacesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-team-inputStatus: Needs input from team on whether/how to proceed.Status: Needs input from team on whether/how to proceed.