Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-dist: use system type checker from package wheel #777

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down