26
26
import sys
27
27
from setuptools import setup , Extension , Distribution
28
28
from setuptools .command .build_ext import build_ext
29
+ from wheel .bdist_wheel import bdist_wheel
29
30
import shutil
30
31
import sysconfig
31
32
@@ -236,6 +237,18 @@ def get_outputs(self):
236
237
return self ._found_paths
237
238
238
239
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
+
239
252
class BinaryDistribution (Distribution ):
240
253
def has_ext_modules (self ):
241
254
return True
@@ -246,6 +259,7 @@ def has_ext_modules(self):
246
259
# Dummy extension to trigger build_ext
247
260
ext_modules = [Extension ('' , sources = [])],
248
261
cmdclass = {
249
- 'build_ext' : libusb_build_ext
262
+ 'build_ext' : libusb_build_ext ,
263
+ 'bdist_wheel' : libusb_bdist_wheel ,
250
264
},
251
265
)
0 commit comments