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

Creating pure Python wheels when using build scripts #3594

Closed
2 tasks done
tueda opened this issue Jan 21, 2021 · 4 comments
Closed
2 tasks done

Creating pure Python wheels when using build scripts #3594

tueda opened this issue Jan 21, 2021 · 4 comments
Labels
kind/feature Feature requests/implementations

Comments

@tueda
Copy link

tueda commented Jan 21, 2021

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

Is there any way to create pure Python wheels (or universal wheels) when using build scripts?

I know that build scripts are still undocumented (#2740), but if I use pyproject.toml like

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.build]
generate-setup-file = false
script = "build.py"

then poetry build creates a platform wheel like hello-0.1.0-cp39-cp39-manylinux2014_x86_64.whl, which makes sense when building C-extensions.

But, when one wants to use build.py to generate some platform-independent resource files from the source (corresponding to setup.py build_py), platform wheels are not needed and pure Python wheels like hello-0.1.0-py3-none-any.whl may suffice.

It would be great if one could select pure Python wheels (and possibly also universal wheels) by configuring in pyproject.toml, for example,

[tool.poetry.build]
pure-python-wheel = true
@tueda tueda added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Jan 21, 2021
@sinoroc
Copy link

sinoroc commented Jan 21, 2021

I think there are already tickets on the topic of the platform tags of the wheel. Maybe you can find some valuable info in those.

@tueda
Copy link
Author

tueda commented Jan 21, 2021

Thank you for the comment. Indeed, it seems that I should have searched "platform tags" more thoroughly in the Issues. I found

The former already has a comment about the fact that poetry assumes platform wheels when build.py is used, pure Python wheels otherwise. I would close this as a duplicate.

@tueda tueda closed this as completed Jan 21, 2021
@gitonthescene
Copy link

FWIW, I think this is still a good idea as a stop gap until there is more full featured support build scripts. Having such an option would make it easier to build with the build script when using --format sdist and not when using --format wheel and avoid building wheels with arbitrary tags, but still have say Cython support when building an sdist.

Currently, the only way to do this is to manually exit the pyproject.toml file, remove the build line and rebuild.

Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Feature requests/implementations
Projects
None yet
Development

No branches or pull requests

4 participants