How to create platform specific wheels? #4619
-
Hi, I am working on a python package that includes a Windows 'dll' for native functionality, and would like to also add Macos and Linux versions. Th package was mostly generated by SWIG, although I've added some helper code to locate the correct dll version for the currently running version of python at runtime. I have the basic build and upload to pypi process going, but the the build step always produces an 'any' wheel in the output 'dist' directory, and my understanding is it should be creating an 'amd64' wheel for windows, and other types of wheel for other OS's etc. Is this right? If so, how do I get setuptools to produce an 'amd64' wheel? I am using this line in my 'pyproject.toml' to add the dlls to the project: [tool.setuptools.package-data] libsgd = ["libsgd/libs/py*/_sgd.pyd"] But this doesn't seem to be enough to make setup tools consider my package to be 'native'. I have heard that it's possible to simply 'rename' the wheel file, but that doesn't sound good! Bye, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Setuptools creates wheels for whatever the current platform is. They need to be post-processed to comply with standards. In the past, you'd have to reproduce a number of steps manually. Today, it is strongly recommended to fit your setup into the structure that https://cibuildwheel.rtfd.io provides. It'll abstract away a ton of infrastructure boilerplate you can reuse both in CI/CD and locally. |
Beta Was this translation helpful? Give feedback.
Finally found a solution this: pass 'has_ext_modules=lambda: True' in your call to setup() in setup.py, and it'll create a platform specific wheel.