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

Consider adding support for more wheel tags. #2051

Open
2 tasks done
arnavb opened this issue Feb 17, 2020 · 2 comments
Open
2 tasks done

Consider adding support for more wheel tags. #2051

arnavb opened this issue Feb 17, 2020 · 2 comments
Labels
kind/feature Feature requests/implementations

Comments

@arnavb
Copy link

arnavb commented Feb 17, 2020

Context: https://stackoverflow.com/q/60243191/6525260

For the package I'm currently developing, I'm considering switching to Poetry from setuptools. This package minimally supports Python 3.6, and I'd like to specify that in the wheel name. Currently, despite the python dependency in pyproject.toml being Python 3.6, the generated wheel still has a py3-none-any.whl tag. I want there to be a py36-none-any.whl tag instead. With setuptools, I would have specified this using

[bdist_wheel]
python-tag = py36

in setup.cfg. There doesn't seem to be an equivalent for Poetry. Is it possible that a config option could be added to support this use case?

Edit:

It seems that this should be generalized to other tags as well. Poetry lacks support for platform specific tags and feature support in that regard would be useful.

Perhaps there should be a simple string config option where you can manually specify what the tags should be?

@arnavb arnavb added the kind/feature Feature requests/implementations label Feb 17, 2020
@filmor filmor mentioned this issue Nov 17, 2020
1 task
@filmor
Copy link

filmor commented Nov 20, 2020

Overriding platform tags would also be useful. Currently, if any build.py script is used, poetry just assumes the most specific tags, in all other cases just py3-none-any.

@arnavb arnavb changed the title Consider adding support for a more specific Python tag. Consider adding support for a more wheel tags. Nov 21, 2020
@arnavb arnavb changed the title Consider adding support for a more wheel tags. Consider adding support for more wheel tags. Nov 21, 2020
@sdispater sdispater added this to the 1.2 milestone Jun 24, 2021
@sdispater sdispater removed this from the 1.2 milestone Aug 31, 2021
@Kaiser1989
Copy link

Kaiser1989 commented Oct 13, 2021

Having the same problem, as we want to distribute already built binaries via poetry. Therefore we need to set these tags manually.
This is what I we came up with to workaround:

pyproject.toml

...
[tool.poetry.build]
script = "build.py"
...

build.py

import setuptools, os

def build(setup_kwargs):
    # Run targeted build separately as poetry does not support target builds yet
    try:
        setuptools.setup(
            **setup_kwargs, 
            script_args = ['bdist_wheel'],
            options = { 
                'bdist_wheel': { 'plat_name': os.getenv('PP_PYTHON_TARGET', 'any') },
                'egg_info': { 'egg_base': './build/' }
            }
        )
    except:
        print("Failed to create targeted wheel")

This will trigger an additional wheel build with given target (here we check for environment variable), leadings to 2 different wheels in dist folder, where one was created by poetry with host information and one created by this 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
Projects
None yet
Development

No branches or pull requests

4 participants