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

Build script should result in generic wheel suffix "-py3-none-any.whl" if no external modules built #8039

Open
2 tasks done
bsdz opened this issue May 29, 2023 · 1 comment · May be fixed by python-poetry/poetry-core#598
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged

Comments

@bsdz
Copy link

bsdz commented May 29, 2023

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

Feature Request

If using the (currently undocumented) build script feature as so:

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

with a build script that has conditional library building as follows:

import os

from mypyc.build import mypycify

extensions = []

if os.environ.get("MYPYCIFY_BUILD", "False").lower() == "true":
    modules = [
        "my_package/submod1/foo.py",
        ...
        "my_package/submodn/bar.py",
    ]
    extensions = mypycify(modules)


def build(setup_kwargs):
    setup_kwargs.update(
        {
            "ext_modules": extensions,
        }
    )

Running poetry build always builds a plaform specific wheel (i.e. "my-package-0.1.1-cp310-cp310-manylinux_2_35_x86_64.whl") even if I specify (by env variable MYPYCIFY_BUILD=True).

It would be better if not specifying any ext_modules results in a non platform wheel like "my-package-0.1.1-py3-none-any.whl".

@bsdz bsdz added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels May 29, 2023
@bsdz
Copy link
Author

bsdz commented May 31, 2023

I've created a workaround plugin poetry-plugin-ignore-build-script.

poetry self add poetry-plugin-ignore-build-script
poetry build --ignore-build-script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant