You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you build a source distribution, these don't get rewritten, but the workspace is gone, so pip install ruff-0.0.267.tar.gz fails to resolve the colored = { workspace = true, features = ["no-color"] } in local_dependencies/ruff/Cargo.toml in the source distribution:
Processing ./ruff-0.0.267.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [22 lines of output]
error: failed to get `ruff` as a dependency of package `ruff_cli v0.0.267 (/tmp/pip-req-build-p8mkavn0/crates/ruff_cli)`
Caused by:
failed to load source for dependency `ruff`
Caused by:
Unable to update /tmp/pip-req-build-p8mkavn0/local_dependencies/ruff
Caused by:
failed to parse manifest at `/tmp/pip-req-build-p8mkavn0/local_dependencies/ruff/Cargo.toml`
Caused by:
error inheriting `colored` from workspace root manifest's `workspace.dependencies.colored`
Caused by:
failed to find a workspace root
💥 maturin failed
Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
Caused by: `cargo metadata` exited with an error:
Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/tmp/pip-modern-metadata-_g8webjv', '--interpreter', '/home/konsti/sdist-ruff/.venv/bin/python']' returned non-zero exit status 1.
Checking for Rust toolchain....
Running `maturin pep517 write-dist-info --metadata-directory /tmp/pip-modern-metadata-_g8webjv --interpreter /home/konsti/sdist-ruff/.venv/bin/python`
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Bug Description
Workspace inherited dev dependencies are not rewritten when creating source distributions.
In ruff, we have a workspace with a
crates
folder that contains aruff
and aruff-cli
crate, where the latter is the main entrypoint.In the main pyproject.toml:
In the main Cargo.toml, we define all the versions, including e.g.
colored
:In crates/ruff/Cargo.toml, we have dev dependencies using them:
When you build a source distribution, these don't get rewritten, but the workspace is gone, so
pip install ruff-0.0.267.tar.gz
fails to resolve thecolored = { workspace = true, features = ["no-color"] }
inlocal_dependencies/ruff/Cargo.toml
in the source distribution:Your maturin version (
maturin --version
)v0.15.1-16-g9fbf8fa (9fbf8fa)
Your Python version (
python -V
)n/a (Python 3.11.2)
Your pip version (
pip -V
)n/a (pip 23.0.1)
What bindings you're using
pyo3
Does
cargo build
work?If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash
/
)?Steps to Reproduce
The text was updated successfully, but these errors were encountered: