From 535661c97659f34759b9f90b24c5d64abfdf04ee Mon Sep 17 00:00:00 2001 From: Hunt Zhan Date: Thu, 9 Jun 2022 17:57:03 +0800 Subject: [PATCH] Resolve #4. --- pywhlobf/post.py | 13 ++++++++----- setup.cfg | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pywhlobf/post.py b/pywhlobf/post.py index a58e47a..4575a5b 100644 --- a/pywhlobf/post.py +++ b/pywhlobf/post.py @@ -1,11 +1,9 @@ import sys from itertools import chain import pathlib +from distutils.util import get_platform -from wheel.bdist_wheel import ( - get_abi_tag, - get_platform as get_platform_tag, -) +from wheel.bdist_wheel import get_abi_tag from wheel.wheelfile import WheelFile @@ -54,7 +52,12 @@ def generate_whl_name( ): python_tag = 'cp' + ''.join(map(str, sys.version_info[:2])) abi_tag = abi_tag or get_abi_tag() - platform_tag = platform_tag or get_platform_tag(input_folder) + platform_tag = platform_tag or get_platform() + + if platform_tag.startswith('linux-'): + # Patch the invalid platform tag. + platform_tag_suffix = platform_tag[len('linux-'):] + platform_tag = 'linux_' + platform_tag_suffix components = [distribution, version] if build_tag: diff --git a/setup.cfg b/setup.cfg index 603b2e7..749332c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,8 +14,8 @@ packages = find: python_requires = >= 3.5, < 3.10 install_requires = Cython >= 0.29.28 - wheel ~= 0.37.1 - fire ~= 0.4.0 + wheel >= 0.37.1 + fire >= 0.4.0 [options.extras_require] cython3 =