Skip to content

Creating pure Python wheels when using build scripts #3594

Closed

Description

@tueda
  • 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

Activity

  1. sinoroc commented on Jan 21, 2021

    @sinoroc

    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.

  2. tueda commented on Jan 21, 2021

    @tueda
    Author

    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.

  3. gitonthescene commented on Jun 24, 2021

    @gitonthescene

    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.

  4. github-actions commented on Mar 2, 2024

    @github-actions

    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.

  5. locked as resolved and limited conversation to collaborators on Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureFeature requests/implementations

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions