Skip to content

Commit 1494c29

Browse files
Platform-specific wheels?
1 parent 25f03b7 commit 1494c29

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

setup.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from setuptools import setup
1919
from setuptools.command.build import build
20+
from wheel.bdist_wheel import bdist_wheel
2021
import shutil
2122
import subprocess
2223

@@ -47,8 +48,22 @@ def run(self):
4748
super().run()
4849

4950

51+
class PlatformBdistWheel(bdist_wheel):
52+
"""Tag wheel as platform-specific since it contains a compiled binary."""
53+
54+
def finalize_options(self):
55+
super().finalize_options()
56+
self.root_is_pure = False
57+
58+
def get_tag(self):
59+
python, abi, plat = super().get_tag()
60+
# Use py3-none but keep the platform tag
61+
return "py3", "none", plat
62+
63+
5064
setup(
5165
cmdclass={
5266
"build": CustomBuildCommand,
67+
"bdist_wheel": PlatformBdistWheel,
5368
},
5469
)

0 commit comments

Comments
 (0)