-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
33 lines (22 loc) · 976 Bytes
/
Copy pathsetup.py
File metadata and controls
33 lines (22 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
from setuptools import Distribution, setup
try:
from setuptools.command.bdist_wheel import bdist_wheel
except ImportError: # pragma: no cover - older setuptools fallback
from wheel.bdist_wheel import bdist_wheel
class BinaryDistribution(Distribution):
"""Force a platform wheel even though the Python wrapper is pure Python."""
def has_ext_modules(self):
return True
class PlatformWheel(bdist_wheel):
"""Build a py3-none-<platform> wheel for ctypes-bundled shared libraries."""
def finalize_options(self):
super().finalize_options()
self.root_is_pure = False
build_tag = os.environ.get("QWENTTS_CPP_WHEEL_BUILD_TAG")
if build_tag and not self.build_number:
self.build_number = build_tag
def get_tag(self):
_python, _abi, platform = super().get_tag()
return "py3", "none", platform
setup(distclass=BinaryDistribution, cmdclass={"bdist_wheel": PlatformWheel})