From f599f74ca25c12aec1961dd28979eef307f40696 Mon Sep 17 00:00:00 2001 From: Carlos Pereira Atencio Date: Fri, 24 Nov 2023 00:09:22 +0000 Subject: [PATCH] Build wheels w/o abi nor python minor version: py3-none-{platform} --- setup.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ee55db3..30a7c59 100644 --- a/setup.py +++ b/setup.py @@ -26,6 +26,7 @@ import sys from setuptools import setup, Extension, Distribution from setuptools.command.build_ext import build_ext +from wheel.bdist_wheel import bdist_wheel import shutil import sysconfig @@ -236,6 +237,18 @@ def get_outputs(self): return self._found_paths +class libusb_bdist_wheel(bdist_wheel): + def finalize_options(self): + bdist_wheel.finalize_options(self) + # This is not a Pure python wheel, so it still needs to be platform specific. + self.root_is_pure = False + + def get_tag(self): + python, abi, plat = bdist_wheel.get_tag(self) + # We can replace the python version and abi, and tag it compatible with all Python 3 versions. + return "py3", "none", plat + + class BinaryDistribution(Distribution): def has_ext_modules(self): return True @@ -246,6 +259,7 @@ def has_ext_modules(self): # Dummy extension to trigger build_ext ext_modules=[Extension('', sources=[])], cmdclass={ - 'build_ext': libusb_build_ext + 'build_ext': libusb_build_ext, + 'bdist_wheel': libusb_bdist_wheel, }, )