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

maturin and uniffi doesn't appear to be using pyproject.toml #1944

Closed
2 tasks done
stusmall opened this issue Feb 17, 2024 · 3 comments
Closed
2 tasks done

maturin and uniffi doesn't appear to be using pyproject.toml #1944

stusmall opened this issue Feb 17, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@stusmall
Copy link

stusmall commented Feb 17, 2024

Bug Description

When trying to build a uniffi project with maturin it doesn't seem to be using the pyproject.toml. I have a minimal project here to show this: https://github.com/stusmall/maturin-uniffi-errors

There are two make commands available, one of them builds a wheel but it ignores the dependencies in the pyproject. The other fails to build because maturin can't find the pyproject.toml. I suspect they both have the same root cause.

Your maturin version (maturin --version)

1.4.0

Your Python version (python -V)

3.11.7

Your pip version (pip -V)

23.3.1

What bindings you're using

uniffi

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

  1. Check out the included repo
  2. (optional) use nix-shell to pull all tools down
  3. type make build to see it build the wheel. Look a the contents of the wheel to see there is nothing referencing the needed dependencies
  4. type build-with-sdist to see the build fail
@stusmall stusmall added the bug Something isn't working label Feb 17, 2024
@stusmall
Copy link
Author

I did a little debugging in maturin yesterday. This appears to be because it assumes the pyproject.toml to be in the same directory as Cargo.toml. I tried to refactor this following a pattern I used with another cffi based project where it would have a empty dummy crate that just forwarded definitions. I didn't have any luck with this

@messense
Copy link
Member

This appears to be because it assumes the pyproject.toml to be in the same directory as Cargo.toml.

Actually it assumes Cargo.toml to be located in the same directory or subdirectory as pyproject.toml, but you can specify manifest-path in [tool.maturin] section of pyproject.toml, but now you have to run maturin in the pyproject.toml directory instead of passing --manifest-path in CLI.

@stusmall
Copy link
Author

That fixed it! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants