uv
uv copied to clipboard
Don't pull foreign cargo packages into workspace
If you do cargo run pip install deptry --no-binary deptry --cache-dir foo from the uv directory:
error: Failed to download distributions
Caused by: Failed to fetch wheel: deptry==0.14.0
Caused by: Failed to build: deptry==0.14.0
Caused by: Build backend failed to build wheel through `build_wheel()` with exit status: 1
--- stdout:
Running `maturin pep517 build-wheel -i /Users/crmarsh/workspace/uv/foo/.tmp9kGP1j/.venv/bin/python --compatibility off`
--- stderr:
error: current package believes it's in a workspace when it's not:
current: /Users/crmarsh/workspace/uv/foo/built-wheels-v0/pypi/deptry/0.14.0/33SZPLpftp49A7cKw7dAq/deptry-0.14.0.tar.gz/Cargo.toml
workspace: /Users/crmarsh/workspace/uv/Cargo.toml
this may be fixable by adding `foo/built-wheels-v0/pypi/deptry/0.14.0/33SZPLpftp49A7cKw7dAq/deptry-0.14.0.tar.gz` to the `workspace.members` array of the manifest located at: /Users/crmarsh/workspace/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.
💥 maturin failed
Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
Caused by: `cargo metadata` exited with an error:
Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/Users/crmarsh/workspace/uv/foo/.tmp9kGP1j/.venv/bin/python', '--compatibility', 'off'] returned non-zero exit status 1
---
We need a way to "stop" Maturin from thinking it's in a workspace.
@konstin -- any ideas?
(This is not the cause of #2490.)
This is a general cargo behavior,
mkdir bar && cd bar && git clone https://github.com/fpgmaas/deptry && cd deptry && cargo check
fails. There seems to be no way to exclude all packages, i've put a feature request upstream: https://github.com/rust-lang/cargo/issues/13600
Yeah we need some sort of isolated flag.
@konstin - I guess we could add an empty workspace = [] to the package we're building if it's not present... but that seems bad.
Does that affect anyone but us when we're developing and putting the cache inside for the uv checkout?
To be clear, this only affects workflows in which the user puts the cache in the same directory as their project, and their project is a Cargo workspace.
what can i do to overcome this error? @charliermarsh