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

Add support for sdist when building python package #695

Closed
reyammer opened this issue Sep 17, 2024 · 5 comments
Closed

Add support for sdist when building python package #695

reyammer opened this issue Sep 17, 2024 · 5 comments
Labels
python Pull requests that update Python package rust Pull requests that update Rust code

Comments

@reyammer
Copy link
Collaborator

uv build currently fails when trying to build sdist.

@ia0 opened PyO3/maturin#2202, we got a reply.

@ia0: is there any way to make it happen with symlinks?

Wondering whether we should just drop sdist for now, release a new -rc for the python module without, and address this later?

@reyammer reyammer added python Pull requests that update Python package rust Pull requests that update Rust code labels Sep 17, 2024
@ia0
Copy link
Member

ia0 commented Sep 17, 2024

I see 2 workarounds:

  • Just exclude the README.md file. The package is functional but without a readme.
  • Delete the rust/cli/README.md file before doing any sdist thing. See Enable maturin sdist with a hack #698 for an example.

@reyammer
Copy link
Collaborator Author

#698 looks good for the automation. For manually building the package, I guess one can just do the same, delete the readme, and do uv build? we could even wrap this in a small "build package" script (those meant to be used manually for testing) as a way to document this until we solve this in a better way?

One I aspect I don't get: in PyO3/maturin#2202 they mention that the problem is about the python dir being outside the rust dir, not specifically related to the readme? (in which case, would symlinks do the trick?) or maybe that's an orthogonal problem?

@ia0
Copy link
Member

ia0 commented Sep 19, 2024

One I aspect I don't get: in PyO3/maturin#2202 they mention that the problem is about the python dir being outside the rust dir, not specifically related to the readme? (in which case, would symlinks do the trick?) or maybe that's an orthogonal problem?

This is a different problem and we are not affected by it anymore. We use maturin from the python directory. We are only affected by PyO3/maturin#2154 (as indicated by the TODOs in the code).

For manually building the package, I guess one can just do the same, delete the readme, and do uv build?

Yes, this should work fine as long as the readme has no modification with respect to the index (otherwise they would be lost by the deletion).

@reyammer
Copy link
Collaborator Author

Sounds good! I'll give it a try and close this issue after testing. Thanks!

@reyammer
Copy link
Collaborator Author

Wrote a POC to build the python package, see #702. There is still an issue with it, but the sdist problem is gone, so I'm closing this. Let's keep discussing in #702 for the remaining problem, there may be a quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python package rust Pull requests that update Rust code
Projects
None yet
Development

No branches or pull requests

2 participants