Skip to content

Commit 4a957fc

Browse files
committed
Fix: don't append python version to injected platform name.
1 parent 165c471 commit 4a957fc

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Diff for: bindings/python/setup.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,19 @@ def run(self):
203203
print("Proper 'develop' support unavailable.")
204204

205205
if 'bdist_wheel' in sys.argv and '--plat-name' not in sys.argv:
206+
# Inject the platform identifier into argv.
207+
# Platform tags are described here:
208+
# https://packaging.python.org/en/latest/specifications/platform-compatibility-tags
209+
#
210+
# I couldn't really find out in time why we need to inject the platform here?
211+
# The cibuildwheel doesn't need it for the Windows job. But for Mac and Linux.
212+
# This here is very dirty and will maybe break in the future.
213+
# Sorry if this is the case and you read this.
214+
# See: https://github.com/capstone-engine/capstone/issues/2445
206215
idx = sys.argv.index('bdist_wheel') + 1
207216
sys.argv.insert(idx, '--plat-name')
208217
name = get_platform()
209-
pyversion = platform.python_version()
210-
major_version, minor_version = map(int, pyversion.split('.')[:2])
211-
sys.argv.insert(idx + 1, name.replace('.', '_').replace('-', '_') + "_" + str(major_version) + str(minor_version))
218+
sys.argv.insert(idx + 1, name.replace('.', '_').replace('-', '_'))
212219

213220
setup(
214221
provides=['capstone'],

0 commit comments

Comments
 (0)