build (https://github.com/pypa/build) is a great tool to create wheels. However, I could not find a way to create platform-specific wheels that I can do with python setup.py --plat-name=linux_x86_64.
I have tried these approaches:
setup.cfg with [bdist_wheel] \ plat-name=linux_x86_64 content. It works well but I want to make this dynamic (on Windows, I want to use win_amd64).python -m build -w -n "--config-setting=--plat-name(=linux_x86_64)", no success.Renaming the created .whl file feels a hacky solution.
What is the state-of-the-art way to resolve this?
Creating a custom command class is not necessary. The syntax to provide plat_name explicitly is like this:
from setuptools import setup
def get_platname():
# do whatever you need here
return "potato"
setup(
name="myproj",
version="0.1",
options={
"bdist_wheel": {
"plat_name": get_platname(),
},
},
)
Using a pure pyproject.toml setup the platform can be set via:
python -m build -w -C="--global-option=--plat-name" -C="--global-option=anything_you_like_here"
Kudos to @sinoroc in the comment above for sharing this link: https://github.com/pypa/build/issues/202
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With