Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cargo path with pyproject.toml #241

Closed
choco opened this issue Nov 27, 2019 · 7 comments · Fixed by #781
Closed

Cargo path with pyproject.toml #241

choco opened this issue Nov 27, 2019 · 7 comments · Fixed by #781

Comments

@choco
Copy link

choco commented Nov 27, 2019

Hello,
my project has a structure similar to this

- crate_name
 |- src
 |- Cargo.toml
 |- python
   |- build.sh
   |- pyproject.toml
   |- tests

The build.sh just executes maturin

maturin build --release --manifest-path ../Cargo.toml

But I'd like to use pyproject.toml for this.
Unfortunately I'm unable to set the manifest-path option from there. Is this something possible? I tried something like this but it doesn't work.

[build-system]
requires = ["maturin"]
build-backend = "maturin"

[tool.maturin]
cargo-extra-args = "--manifest-path ../Cargo.toml"
@konstin
Copy link
Member

konstin commented Nov 27, 2019

Could you move the pyproject.toml a directory up and run maturin in crate_name instead of python?

@choco
Copy link
Author

choco commented Nov 27, 2019

That's the issue, I actually don't want to move it up there :( and would like to keep things separated.

@konstin
Copy link
Member

konstin commented Nov 27, 2019

For the two cases where you actually need a pyproject.toml (installing from an sdist and installing from git or a directory), the pyproject.toml needs to be in the project root anyway, so I only want to support that case.

@choco
Copy link
Author

choco commented Nov 27, 2019

Seems fair, thanks for your help and the quick support :)

@choco choco closed this as completed Nov 27, 2019
@anthrotype
Copy link

I wish to package a third-party crate that I clone as git submodule and thus I can't/don't want to modify. So I'd like to have my pyproject.toml file in a different directory from the upstream Cargo.toml, and specify a manifest_path in my pyproject.toml [tool.maturin] section.

@messense
Copy link
Member

@anthrotype Opened #781

@anthrotype
Copy link

@messense thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants