setuptools-rust
setuptools-rust copied to clipboard
Failiure when building a wheel from a rust crate with a local dependency
I have a rust crate in a workspace with a local dependency. Basically I have
project_workspace_dir
├─project-core
└─project-python
And my project_python depends on project_core in Cargo.toml like this:
[dependencies]
project-core = { path = "../project-core" }
When I call python -m build -s I see the following in my logs:
creating project-0.1.0/../project-core
creating project-0.1.0/../project-core/src
and
copying ../project-core/Cargo.toml -> tr0-0.1.0/../project-core
copying ../project-core/src/error.rs -> tr0-0.1.0/../project-core/src
copying ../project-core/src/lib.rs -> tr0-0.1.0/../project-core/src
This leads to project-core ending up next to dist
I think the optimal solution here would be to detect local dependencies, actually copy them to the archive and rewrite Cargo.toml for the affected crate, but I'm not sure how reasonable that is.
MWE here
I think the optimal solution here would be to detect local dependencies, actually copy them to the archive and rewrite Cargo.toml for the affected crate, but I'm not sure how reasonable that is.
This is implemented in maturin but it introduces some other issues: https://github.com/PyO3/maturin/issues?q=is%3Aissue%20label%3Asdist%20label%3Abug
For simplicity I don't think we should implement it in setuptools-rust.