Skip to content

Commit

Permalink
Build wheels w/o abi nor python minor version: py3-none-{platform}
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosperate committed Nov 24, 2023
1 parent 7a62b64 commit 37c4603
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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,
},
)

0 comments on commit 37c4603

Please sign in to comment.