From 62f84025849a9b8b9e0c66128ee9493ef06aaa8e Mon Sep 17 00:00:00 2001 From: sgqy Date: Tue, 28 Mar 2023 19:09:24 +0900 Subject: [PATCH] python-dist: use system type checker from package `wheel` --- setup.py | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/setup.py b/setup.py index c6f7bad8e..c3dcc1cb5 100644 --- a/setup.py +++ b/setup.py @@ -144,29 +144,8 @@ class BDistWheelCommand(wheel.bdist_wheel.bdist_wheel, object): @staticmethod def _determine_platform_tag(): - if sys.platform == 'win32': - if 'amd64' in sys.version.lower(): - return 'win-amd64' - return sys.platform - - if sys.platform == 'darwin': - _, _, _, _, machine = os.uname() - if machine == 'x86_64': - return 'macosx-10.9-{}'.format(machine) - if machine == 'arm64': - return 'macosx-11.0-{}'.format(machine) - else: - raise NotImplementedError - - if os.name == 'posix': - _, _, _, _, machine = os.uname() - return 'manylinux1-{}'.format(machine) - - warnings.warn( - 'Windows macos and linux are all not detected, ' - 'Proper distribution name cannot be determined.') - from distutils.util import get_platform - return get_platform() + from wheel.vendored.packaging.tags import platform_tags + return next(platform_tags()) def initialize_options(self): super(BDistWheelCommand, self).initialize_options()