Skip to content

Commit f599f74

Browse files
committed
Build wheels w/o abi nor python minor version: py3-none-{platform}
1 parent 72b6fba commit f599f74

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Diff for: setup.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import sys
2727
from setuptools import setup, Extension, Distribution
2828
from setuptools.command.build_ext import build_ext
29+
from wheel.bdist_wheel import bdist_wheel
2930
import shutil
3031
import sysconfig
3132

@@ -236,6 +237,18 @@ def get_outputs(self):
236237
return self._found_paths
237238

238239

240+
class libusb_bdist_wheel(bdist_wheel):
241+
def finalize_options(self):
242+
bdist_wheel.finalize_options(self)
243+
# This is not a Pure python wheel, so it still needs to be platform specific.
244+
self.root_is_pure = False
245+
246+
def get_tag(self):
247+
python, abi, plat = bdist_wheel.get_tag(self)
248+
# We can replace the python version and abi, and tag it compatible with all Python 3 versions.
249+
return "py3", "none", plat
250+
251+
239252
class BinaryDistribution(Distribution):
240253
def has_ext_modules(self):
241254
return True
@@ -246,6 +259,7 @@ def has_ext_modules(self):
246259
# Dummy extension to trigger build_ext
247260
ext_modules=[Extension('', sources=[])],
248261
cmdclass={
249-
'build_ext': libusb_build_ext
262+
'build_ext': libusb_build_ext,
263+
'bdist_wheel': libusb_bdist_wheel,
250264
},
251265
)

0 commit comments

Comments
 (0)