From d3340dc68cccdaa0eece73cb7cf6e9a41238ce72 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Wed, 30 Dec 2020 07:04:33 +0900 Subject: [PATCH] Imported Upstream version 42.0.1 --- .bumpversion.cfg | 2 +- CHANGES.rst | 6 ++++++ setup.cfg | 2 +- setuptools/tests/test_wheel.py | 9 +++++++++ setuptools/wheel.py | 2 +- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 0551f1b..e37acce 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 42.0.0 +current_version = 42.0.1 commit = True tag = True diff --git a/CHANGES.rst b/CHANGES.rst index 0a8696c..da657c2 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,9 @@ +v42.0.1 +------- + +* #1918: Fix regression in handling wheels compatibility tags. + + v42.0.0 ------- diff --git a/setup.cfg b/setup.cfg index c0aa35b..b8e5427 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,7 @@ universal = 1 [metadata] name = setuptools -version = 42.0.0 +version = 42.0.1 description = Easily download, build, install, upgrade, and uninstall Python packages author = Python Packaging Authority author_email = distutils-sig@python.org diff --git a/setuptools/tests/test_wheel.py b/setuptools/tests/test_wheel.py index d50816c..55d346c 100644 --- a/setuptools/tests/test_wheel.py +++ b/setuptools/tests/test_wheel.py @@ -18,6 +18,7 @@ import pytest from pkg_resources import Distribution, PathMetadata, PY_MAJOR from setuptools.extern.packaging.utils import canonicalize_name +from setuptools.extern.packaging.tags import parse_tag from setuptools.wheel import Wheel from .contexts import tempdir @@ -571,3 +572,11 @@ def test_wheel_no_dist_dir(): _check_wheel_install(wheel_path, install_dir, None, project_name, version, None) + + +def test_wheel_is_compatible(monkeypatch): + def sys_tags(): + for t in parse_tag('cp36-cp36m-manylinux1_x86_64'): + yield t + monkeypatch.setattr('setuptools.wheel.sys_tags', sys_tags) + assert Wheel('onnxruntime-0.1.2-cp36-cp36m-manylinux1_x86_64.whl').is_compatible() diff --git a/setuptools/wheel.py b/setuptools/wheel.py index 3effd79..025aaa8 100644 --- a/setuptools/wheel.py +++ b/setuptools/wheel.py @@ -77,7 +77,7 @@ class Wheel: def is_compatible(self): '''Is the wheel is compatible with the current platform?''' - supported_tags = set(map(str, sys_tags())) + supported_tags = set((t.interpreter, t.abi, t.platform) for t in sys_tags()) return next((True for t in self.tags() if t in supported_tags), False) def egg_name(self): -- 2.34.1