From 37ce1c4c7638bdc2c88c0c932e4a50e449bf070cbf1d5aabe56f9e1bb8f9b052 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Tue, 6 Aug 2019 05:00:23 +0000 Subject: [PATCH 1/7] - update to 19.1: * Add the ``packaging.tags`` module. * Correctly handle two-digit versions in ``python_version`` OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-packaging?expand=0&rev=25 --- packaging-19.0.tar.gz | 3 --- packaging-19.1.tar.gz | 3 +++ python-packaging.changes | 7 +++++++ python-packaging.spec | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) delete mode 100644 packaging-19.0.tar.gz create mode 100644 packaging-19.1.tar.gz diff --git a/packaging-19.0.tar.gz b/packaging-19.0.tar.gz deleted file mode 100644 index 4695224..0000000 --- a/packaging-19.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0c98a5d0be38ed775798ece1b9727178c4469d9c3b4ada66e8e6b7849f8732af -size 48608 diff --git a/packaging-19.1.tar.gz b/packaging-19.1.tar.gz new file mode 100644 index 0000000..4dd3b91 --- /dev/null +++ b/packaging-19.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c491ca87294da7cc01902edbe30a5bc6c4c28172b5138ab4e4aa1b9d7bfaeafe +size 57886 diff --git a/python-packaging.changes b/python-packaging.changes index d3c41ca..189e4fb 100644 --- a/python-packaging.changes +++ b/python-packaging.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Aug 6 04:58:54 UTC 2019 - Thomas Bechtold + +- update to 19.1: + * Add the ``packaging.tags`` module. + * Correctly handle two-digit versions in ``python_version`` + ------------------------------------------------------------------- Sat Mar 9 04:56:34 UTC 2019 - John Vandenberg diff --git a/python-packaging.spec b/python-packaging.spec index 20dc4b3..295b61e 100644 --- a/python-packaging.spec +++ b/python-packaging.spec @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_with test Name: python-packaging -Version: 19.0 +Version: 19.1 Release: 0 Summary: Core utilities for Python packages License: Apache-2.0 From 4ba3c858e1bf25293691e18e47f35032c91d7dccfc86c478666066ca8150cf2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 8 Aug 2019 10:36:18 +0000 Subject: [PATCH 2/7] Accepting request 721714 from home:dancermak:branches:devel:languages:python Add Requires:python-attrs as this is a new dependency OBS-URL: https://build.opensuse.org/request/show/721714 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-packaging?expand=0&rev=26 --- python-packaging.changes | 6 ++++++ python-packaging.spec | 1 + 2 files changed, 7 insertions(+) diff --git a/python-packaging.changes b/python-packaging.changes index 189e4fb..014b3ad 100644 --- a/python-packaging.changes +++ b/python-packaging.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Aug 8 10:24:07 UTC 2019 - Dan Čermák + +- Add Requires:python-attrs as this is a new dependency + this fixes bsc#1144506 + ------------------------------------------------------------------- Tue Aug 6 04:58:54 UTC 2019 - Thomas Bechtold diff --git a/python-packaging.spec b/python-packaging.spec index 295b61e..cef556c 100644 --- a/python-packaging.spec +++ b/python-packaging.spec @@ -30,6 +30,7 @@ BuildRequires: %{python_module six} BuildRequires: fdupes BuildRequires: python-rpm-macros # https://github.com/pypa/packaging/issues/91 +Requires: python-attrs Requires: python-pyparsing >= 2.0.2 Requires: python-six BuildArch: noarch From 585d4a79cee69525e9ef17854e8619ff1f36922db2c9be5afac271659c276a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 14 Aug 2019 09:33:53 +0000 Subject: [PATCH 3/7] Accepting request 723243 from home:dancermak:branches:devel:languages:python enable unit test run via _multibuild OBS-URL: https://build.opensuse.org/request/show/723243 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-packaging?expand=0&rev=27 --- ...s-test_linux_platforms_manylinux-for.patch | 39 +++++++++++ 0002-Fix-check-for-64-bit-OS.patch | 70 +++++++++++++++++++ ...onal-test-to-get-100-branch-coverage.patch | 32 +++++++++ ...ersion_detection-failure-on-32-bit-L.patch | 26 +++++++ _multibuild | 3 + python-packaging.changes | 12 ++++ python-packaging.spec | 30 ++++++-- 7 files changed, 207 insertions(+), 5 deletions(-) create mode 100644 0001-Fix-test-failures-test_linux_platforms_manylinux-for.patch create mode 100644 0002-Fix-check-for-64-bit-OS.patch create mode 100644 0003-Add-additional-test-to-get-100-branch-coverage.patch create mode 100644 0004-Fix-test_macos_version_detection-failure-on-32-bit-L.patch create mode 100644 _multibuild diff --git a/0001-Fix-test-failures-test_linux_platforms_manylinux-for.patch b/0001-Fix-test-failures-test_linux_platforms_manylinux-for.patch new file mode 100644 index 0000000..c7c081f --- /dev/null +++ b/0001-Fix-test-failures-test_linux_platforms_manylinux-for.patch @@ -0,0 +1,39 @@ +From ee35f4ff365c3a65872f2d2ba5320c6673a5859a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= +Date: Thu, 8 Aug 2019 14:39:57 +0200 +Subject: [PATCH 1/4] Fix test failures test_linux_platforms_manylinux* for non + x86_64 + +Theses tests are implicitly assuming that they are being run on x86_64 or i686, +but fail on ARM, PPC, etc. +--- + tests/test_tags.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/tests/test_tags.py b/tests/test_tags.py +index 0bb4fd6..1f1441e 100644 +--- a/tests/test_tags.py ++++ b/tests/test_tags.py +@@ -511,7 +511,8 @@ def test_linux_platforms_manylinux1(monkeypatch): + if platform.system() != "Linux": + monkeypatch.setattr(distutils.util, "get_platform", lambda: "linux_x86_64") + platforms = tags._linux_platforms(is_32bit=False) +- assert platforms == ["manylinux1_x86_64", "linux_x86_64"] ++ arch = platform.machine() ++ assert platforms == ["manylinux1_" + arch, "linux_" + arch] + + + def test_linux_platforms_manylinux2010(monkeypatch): +@@ -521,7 +522,8 @@ def test_linux_platforms_manylinux2010(monkeypatch): + if platform.system() != "Linux": + monkeypatch.setattr(distutils.util, "get_platform", lambda: "linux_x86_64") + platforms = tags._linux_platforms(is_32bit=False) +- expected = ["manylinux2010_x86_64", "manylinux1_x86_64", "linux_x86_64"] ++ arch = platform.machine() ++ expected = ["manylinux2010_" + arch, "manylinux1_" + arch, "linux_" + arch] + assert platforms == expected + + +-- +2.22.0 + diff --git a/0002-Fix-check-for-64-bit-OS.patch b/0002-Fix-check-for-64-bit-OS.patch new file mode 100644 index 0000000..2e7f0ba --- /dev/null +++ b/0002-Fix-check-for-64-bit-OS.patch @@ -0,0 +1,70 @@ +From 73c4a178654cf0ffe64d2f10155f7d7978f3622d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= +Date: Thu, 8 Aug 2019 15:44:09 +0200 +Subject: [PATCH 2/4] Fix check for 64 bit OS + +distutils.util.get_platform() returns "linux-x86_64" on 64 bit Linux and not +"linux_86_64" as assumed by this function. Instead we use the first element +returned by platform.architecture() and move the check into a separate fixture. + +Furthermore, we have to check whether the current OS is x86-based, as the +results don't match otherwise. +--- + tests/test_tags.py | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +diff --git a/tests/test_tags.py b/tests/test_tags.py +index 1f1441e..9ec30a4 100644 +--- a/tests/test_tags.py ++++ b/tests/test_tags.py +@@ -11,6 +11,7 @@ except ImportError: + import distutils.util + + import platform ++import re + import sys + import sysconfig + import types +@@ -26,6 +27,16 @@ def example_tag(): + return tags.Tag("py3", "none", "any") + + ++@pytest.fixture ++def is_x86(): ++ return re.match(r"(i\d86|x86_64)", platform.machine()) is not None ++ ++ ++@pytest.fixture ++def is_64bit_os(): ++ return platform.architecture()[0] == "64bit" ++ ++ + def test_tag_lowercasing(): + tag = tags.Tag("PY3", "None", "ANY") + assert tag.interpreter == "py3" +@@ -486,18 +497,16 @@ def test_have_compatible_glibc(monkeypatch): + assert not tags._have_compatible_glibc(2, 4) + + +-def test_linux_platforms_64bit_on_64bit_os(monkeypatch): +- is_64bit_os = distutils.util.get_platform().endswith("_x86_64") +- if platform.system() != "Linux" or not is_64bit_os: ++def test_linux_platforms_64bit_on_64bit_os(is_64bit_os, is_x86, monkeypatch): ++ if platform.system() != "Linux" or not is_64bit_os or not is_x86: + monkeypatch.setattr(distutils.util, "get_platform", lambda: "linux_x86_64") + monkeypatch.setattr(tags, "_is_manylinux_compatible", lambda *args: False) + linux_platform = tags._linux_platforms(is_32bit=False)[-1] + assert linux_platform == "linux_x86_64" + + +-def test_linux_platforms_32bit_on_64bit_os(monkeypatch): +- is_64bit_os = distutils.util.get_platform().endswith("_x86_64") +- if platform.system() != "Linux" or not is_64bit_os: ++def test_linux_platforms_32bit_on_64bit_os(is_64bit_os, is_x86, monkeypatch): ++ if platform.system() != "Linux" or not is_64bit_os or not is_x86: + monkeypatch.setattr(distutils.util, "get_platform", lambda: "linux_x86_64") + monkeypatch.setattr(tags, "_is_manylinux_compatible", lambda *args: False) + linux_platform = tags._linux_platforms(is_32bit=True)[-1] +-- +2.22.0 + diff --git a/0003-Add-additional-test-to-get-100-branch-coverage.patch b/0003-Add-additional-test-to-get-100-branch-coverage.patch new file mode 100644 index 0000000..ae52d5f --- /dev/null +++ b/0003-Add-additional-test-to-get-100-branch-coverage.patch @@ -0,0 +1,32 @@ +From e25b14f0ab054dbde4c2bf274f938a0f74ebb823 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= +Date: Thu, 8 Aug 2019 15:45:12 +0200 +Subject: [PATCH 3/4] Add additional test to get 100% branch coverage + +the else: branch was not covered in tags._linux_platforms() due to the from the +previous commit +--- + tests/test_tags.py | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/tests/test_tags.py b/tests/test_tags.py +index 9ec30a4..5ffbfa5 100644 +--- a/tests/test_tags.py ++++ b/tests/test_tags.py +@@ -513,6 +513,13 @@ def test_linux_platforms_32bit_on_64bit_os(is_64bit_os, is_x86, monkeypatch): + assert linux_platform == "linux_i686" + + ++def test_linux_platforms_manylinux_unsupported(monkeypatch): ++ monkeypatch.setattr(distutils.util, "get_platform", lambda: "linux_x86_64") ++ monkeypatch.setattr(tags, "_is_manylinux_compatible", lambda *args: False) ++ linux_platform = tags._linux_platforms(is_32bit=False) ++ assert linux_platform == ["linux_x86_64"] ++ ++ + def test_linux_platforms_manylinux1(monkeypatch): + monkeypatch.setattr( + tags, "_is_manylinux_compatible", lambda name, _: name == "manylinux1" +-- +2.22.0 + diff --git a/0004-Fix-test_macos_version_detection-failure-on-32-bit-L.patch b/0004-Fix-test_macos_version_detection-failure-on-32-bit-L.patch new file mode 100644 index 0000000..f233f9d --- /dev/null +++ b/0004-Fix-test_macos_version_detection-failure-on-32-bit-L.patch @@ -0,0 +1,26 @@ +From d691f8387975b426585bb197fc3f8d8ad6ba02c2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= +Date: Thu, 8 Aug 2019 15:54:48 +0200 +Subject: [PATCH 4/4] Fix test_macos_version_detection failure on 32 bit Linux + +tags._mac_arch always returns i386 on 32 bit Linux and thereby +tags._mac_platforms()[0] ends with "i386" even in the arch="x86_64" case +--- + tests/test_tags.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tests/test_tags.py b/tests/test_tags.py +index 5ffbfa5..0e5b0c6 100644 +--- a/tests/test_tags.py ++++ b/tests/test_tags.py +@@ -183,6 +183,7 @@ def test_macos_version_detection(monkeypatch): + def test_macos_arch_detection(arch, monkeypatch): + if platform.system() != "Darwin" or platform.mac_ver()[2] != arch: + monkeypatch.setattr(platform, "mac_ver", lambda: ("10.14", ("", "", ""), arch)) ++ monkeypatch.setattr(tags, "_mac_arch", lambda *args: arch) + assert tags._mac_platforms((10, 14))[0].endswith(arch) + + +-- +2.22.0 + diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/python-packaging.changes b/python-packaging.changes index 014b3ad..a3c485b 100644 --- a/python-packaging.changes +++ b/python-packaging.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu Aug 8 11:41:45 UTC 2019 - Dan Čermák + +- Enable tests via _multibuild + Add patches from https://github.com/pypa/packaging/pull/176: + * 0001-Fix-test-failures-test_linux_platforms_manylinux-for.patch + * 0002-Fix-check-for-64-bit-OS.patch + * 0003-Add-additional-test-to-get-100-branch-coverage.patch + * 0004-Fix-test_macos_version_detection-failure-on-32-bit-L.patch + (these fix the tests on non-x86 platforms and can be dropped on the next + release) + ------------------------------------------------------------------- Thu Aug 8 10:24:07 UTC 2019 - Dan Čermák diff --git a/python-packaging.spec b/python-packaging.spec index cef556c..17d9ad8 100644 --- a/python-packaging.spec +++ b/python-packaging.spec @@ -17,7 +17,15 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%define skip_python2 1 +%else +%define psuffix %{nil} %bcond_with test +%endif Name: python-packaging Version: 19.1 Release: 0 @@ -26,6 +34,11 @@ License: Apache-2.0 Group: Development/Languages/Python URL: https://github.com/pypa/packaging Source: https://pypi.io/packages/source/p/packaging/packaging-%{version}.tar.gz +# FIXME: drop these patches on the next release after 19.1 +Patch0: 0001-Fix-test-failures-test_linux_platforms_manylinux-for.patch +Patch1: 0002-Fix-check-for-64-bit-OS.patch +Patch2: 0003-Add-additional-test-to-get-100-branch-coverage.patch +Patch3: 0004-Fix-test_macos_version_detection-failure-on-32-bit-L.patch BuildRequires: %{python_module six} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -50,12 +63,22 @@ Core utilities for Python packages %prep %setup -q -n packaging-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 # sdist must provide a packaging.egg-info, used below in install phase test -d packaging.egg-info %build %python_build +%if %{with test} +%check +%python_exec %{_bindir}/py.test +%endif # %%{with_test} + +%if !%{with test} %install %python_install # Replace distutils generated egg-info, which varies in metadata version and @@ -66,15 +89,12 @@ cp -r packaging.egg-info %{buildroot}%{$python_sitelib}/packaging-%{version}-py% } %python_expand %fdupes %{buildroot}%{$python_sitelib} -%if %{with test} -%check -%python_exec %{_bindir}/py.test -%endif - %files %{python_files} %license LICENSE LICENSE.APACHE LICENSE.BSD %doc CHANGELOG.rst README.rst %{python_sitelib}/packaging %{python_sitelib}/packaging-%{version}-py*.egg-info/ +%endif # !%%{with_test} + %changelog From 41760e8993a40ec5a51bb8963665742c0138205517b74da436cb06198ffcf091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 15 Aug 2019 08:35:16 +0000 Subject: [PATCH 4/7] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-packaging?expand=0&rev=28 --- python-packaging.spec | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/python-packaging.spec b/python-packaging.spec index 17d9ad8..0d34aa6 100644 --- a/python-packaging.spec +++ b/python-packaging.spec @@ -21,12 +21,11 @@ %if "%{flavor}" == "test" %define psuffix -test %bcond_without test -%define skip_python2 1 %else %define psuffix %{nil} %bcond_with test %endif -Name: python-packaging +Name: python-packaging%{psuffix} Version: 19.1 Release: 0 Summary: Core utilities for Python packages @@ -42,8 +41,6 @@ Patch3: 0004-Fix-test_macos_version_detection-failure-on-32-bit-L.patch BuildRequires: %{python_module six} BuildRequires: fdupes BuildRequires: python-rpm-macros -# https://github.com/pypa/packaging/issues/91 -Requires: python-attrs Requires: python-pyparsing >= 2.0.2 Requires: python-six BuildArch: noarch @@ -75,7 +72,7 @@ test -d packaging.egg-info %if %{with test} %check -%python_exec %{_bindir}/py.test +%pytest %endif # %%{with_test} %if !%{with test} From b8f1af4c0c014b6b385fb0a1e3a9ffe13df1d1854a01c84c21a7a22d4da3450d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 15 Aug 2019 08:35:40 +0000 Subject: [PATCH 5/7] - Fix a bit the multibuild conversion - Remove the attrs from the deps as they are no longer needed OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-packaging?expand=0&rev=29 --- python-packaging.changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python-packaging.changes b/python-packaging.changes index a3c485b..292af39 100644 --- a/python-packaging.changes +++ b/python-packaging.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Aug 15 08:35:19 UTC 2019 - Tomáš Chvátal + +- Fix a bit the multibuild conversion +- Remove the attrs from the deps as they are no longer needed + ------------------------------------------------------------------- Thu Aug 8 11:41:45 UTC 2019 - Dan Čermák From e1805b374cad5fcf26a75bf70012769e45b4ae0680875b3684eb5368b0c1f879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 19 Aug 2019 08:32:10 +0000 Subject: [PATCH 6/7] Accepting request 724501 from home:dancermak:branches:devel:languages:python drop dependency on attrs OBS-URL: https://build.opensuse.org/request/show/724501 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-packaging?expand=0&rev=30 --- ...s-test_linux_platforms_manylinux-for.patch | 2 +- 0002-Fix-check-for-64-bit-OS.patch | 2 +- ...onal-test-to-get-100-branch-coverage.patch | 2 +- ...ersion_detection-failure-on-32-bit-L.patch | 2 +- 0005-Drop-dependency-on-attrs.patch | 107 ++++++++++++++++++ python-packaging.changes | 7 ++ python-packaging.spec | 2 + 7 files changed, 120 insertions(+), 4 deletions(-) create mode 100644 0005-Drop-dependency-on-attrs.patch diff --git a/0001-Fix-test-failures-test_linux_platforms_manylinux-for.patch b/0001-Fix-test-failures-test_linux_platforms_manylinux-for.patch index c7c081f..787b6e2 100644 --- a/0001-Fix-test-failures-test_linux_platforms_manylinux-for.patch +++ b/0001-Fix-test-failures-test_linux_platforms_manylinux-for.patch @@ -1,7 +1,7 @@ From ee35f4ff365c3a65872f2d2ba5320c6673a5859a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 8 Aug 2019 14:39:57 +0200 -Subject: [PATCH 1/4] Fix test failures test_linux_platforms_manylinux* for non +Subject: [PATCH 1/5] Fix test failures test_linux_platforms_manylinux* for non x86_64 Theses tests are implicitly assuming that they are being run on x86_64 or i686, diff --git a/0002-Fix-check-for-64-bit-OS.patch b/0002-Fix-check-for-64-bit-OS.patch index 2e7f0ba..c6d964b 100644 --- a/0002-Fix-check-for-64-bit-OS.patch +++ b/0002-Fix-check-for-64-bit-OS.patch @@ -1,7 +1,7 @@ From 73c4a178654cf0ffe64d2f10155f7d7978f3622d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 8 Aug 2019 15:44:09 +0200 -Subject: [PATCH 2/4] Fix check for 64 bit OS +Subject: [PATCH 2/5] Fix check for 64 bit OS distutils.util.get_platform() returns "linux-x86_64" on 64 bit Linux and not "linux_86_64" as assumed by this function. Instead we use the first element diff --git a/0003-Add-additional-test-to-get-100-branch-coverage.patch b/0003-Add-additional-test-to-get-100-branch-coverage.patch index ae52d5f..e3d6c70 100644 --- a/0003-Add-additional-test-to-get-100-branch-coverage.patch +++ b/0003-Add-additional-test-to-get-100-branch-coverage.patch @@ -1,7 +1,7 @@ From e25b14f0ab054dbde4c2bf274f938a0f74ebb823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 8 Aug 2019 15:45:12 +0200 -Subject: [PATCH 3/4] Add additional test to get 100% branch coverage +Subject: [PATCH 3/5] Add additional test to get 100% branch coverage the else: branch was not covered in tags._linux_platforms() due to the from the previous commit diff --git a/0004-Fix-test_macos_version_detection-failure-on-32-bit-L.patch b/0004-Fix-test_macos_version_detection-failure-on-32-bit-L.patch index f233f9d..05b7cc1 100644 --- a/0004-Fix-test_macos_version_detection-failure-on-32-bit-L.patch +++ b/0004-Fix-test_macos_version_detection-failure-on-32-bit-L.patch @@ -1,7 +1,7 @@ From d691f8387975b426585bb197fc3f8d8ad6ba02c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 8 Aug 2019 15:54:48 +0200 -Subject: [PATCH 4/4] Fix test_macos_version_detection failure on 32 bit Linux +Subject: [PATCH 4/5] Fix test_macos_version_detection failure on 32 bit Linux tags._mac_arch always returns i386 on 32 bit Linux and thereby tags._mac_platforms()[0] ends with "i386" even in the arch="x86_64" case diff --git a/0005-Drop-dependency-on-attrs.patch b/0005-Drop-dependency-on-attrs.patch new file mode 100644 index 0000000..80275b2 --- /dev/null +++ b/0005-Drop-dependency-on-attrs.patch @@ -0,0 +1,107 @@ +From 3731ce275df3061d84a6014ec732747e5ae5819e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= +Date: Tue, 13 Aug 2019 11:57:09 +0200 +Subject: [PATCH 5/5] Drop dependency on attrs + +- replace tags.Tag with a custom implementation instead of using @attr.s +- add a sanity check for __hash__() +- drop attrs from setup.py + +This fixes #178 +--- + packaging/tags.py | 37 ++++++++++++++++++++++++++++++------- + setup.py | 2 +- + tests/test_tags.py | 6 ++++++ + 3 files changed, 37 insertions(+), 8 deletions(-) + +diff --git a/packaging/tags.py b/packaging/tags.py +index c472b58..c9b5119 100644 +--- a/packaging/tags.py ++++ b/packaging/tags.py +@@ -11,8 +11,6 @@ import sys + import sysconfig + import warnings + +-import attr +- + + INTERPRETER_SHORT_NAMES = { + "python": "py", # Generic. +@@ -26,14 +24,39 @@ INTERPRETER_SHORT_NAMES = { + _32_BIT_INTERPRETER = sys.maxsize <= 2 ** 32 + + +-@attr.s(frozen=True, repr=False) + class Tag(object): +- interpreter = attr.ib(converter=str.lower) +- abi = attr.ib(converter=str.lower) +- platform = attr.ib(converter=str.lower) ++ ++ __slots__ = ["_interpreter", "_abi", "_platform"] ++ ++ def __init__(self, interpreter, abi, platform): ++ self._interpreter = str.lower(interpreter) ++ self._abi = str.lower(abi) ++ self._platform = str.lower(platform) ++ ++ @property ++ def interpreter(self): ++ return self._interpreter ++ ++ @property ++ def abi(self): ++ return self._abi ++ ++ @property ++ def platform(self): ++ return self._platform ++ ++ def __eq__(self, other): ++ return ( ++ (self.platform == other.platform) ++ and (self.abi == other.abi) ++ and (self.interpreter == other.interpreter) ++ ) ++ ++ def __hash__(self): ++ return hash((self._interpreter, self._abi, self._platform)) + + def __str__(self): +- return "{}-{}-{}".format(self.interpreter, self.abi, self.platform) ++ return "{}-{}-{}".format(self._interpreter, self._abi, self._platform) + + def __repr__(self): + return "<{self} @ {self_id}>".format(self=self, self_id=id(self)) +diff --git a/setup.py b/setup.py +index 874512b..23007c7 100644 +--- a/setup.py ++++ b/setup.py +@@ -48,7 +48,7 @@ setup( + author=about["__author__"], + author_email=about["__email__"], + python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", +- install_requires=["attrs", "pyparsing>=2.0.2", "six"], # Needed to avoid issue #91 ++ install_requires=["pyparsing>=2.0.2", "six"], # Needed to avoid issue #91 + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", +diff --git a/tests/test_tags.py b/tests/test_tags.py +index 0bb4fd6..a6d50f3 100644 +--- a/tests/test_tags.py ++++ b/tests/test_tags.py +@@ -43,6 +43,12 @@ def test_tag_hashing(example_tag): + assert example_tag in tags + + ++def test_tag_hash_equality(example_tag): ++ equal_tag = tags.Tag("py3", "none", "any") ++ assert example_tag == equal_tag ++ assert example_tag.__hash__() == equal_tag.__hash__() ++ ++ + def test_tag_str(example_tag): + assert str(example_tag) == "py3-none-any" + +-- +2.22.0 + diff --git a/python-packaging.changes b/python-packaging.changes index 292af39..eb2fa99 100644 --- a/python-packaging.changes +++ b/python-packaging.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Aug 19 08:15:30 UTC 2019 - Dan Čermák + +- Remove dependency on attrs + Add: 0005-Drop-dependency-on-attrs.patch + this fixes bsc#1144506 + ------------------------------------------------------------------- Thu Aug 15 08:35:19 UTC 2019 - Tomáš Chvátal diff --git a/python-packaging.spec b/python-packaging.spec index 0d34aa6..46d3c68 100644 --- a/python-packaging.spec +++ b/python-packaging.spec @@ -38,6 +38,7 @@ Patch0: 0001-Fix-test-failures-test_linux_platforms_manylinux-for.patch Patch1: 0002-Fix-check-for-64-bit-OS.patch Patch2: 0003-Add-additional-test-to-get-100-branch-coverage.patch Patch3: 0004-Fix-test_macos_version_detection-failure-on-32-bit-L.patch +Patch4: 0005-Drop-dependency-on-attrs.patch BuildRequires: %{python_module six} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -64,6 +65,7 @@ Core utilities for Python packages %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 # sdist must provide a packaging.egg-info, used below in install phase test -d packaging.egg-info From 410e0b9b03047f8239eafd655202e47f745233f347ab01d15e034e190ee2079e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 21 Aug 2019 09:25:26 +0000 Subject: [PATCH 7/7] Accepting request 724985 from home:dancermak:branches:devel:languages:python Drop attrs dependency from packaging.egg-info/requires.txt OBS-URL: https://build.opensuse.org/request/show/724985 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-packaging?expand=0&rev=31 --- python-packaging.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python-packaging.spec b/python-packaging.spec index 46d3c68..dbd0066 100644 --- a/python-packaging.spec +++ b/python-packaging.spec @@ -69,6 +69,9 @@ Core utilities for Python packages # sdist must provide a packaging.egg-info, used below in install phase test -d packaging.egg-info +# FIXME: drop this on the next release after 19.1 +sed -i '/^attrs/d' packaging.egg-info/requires.txt + %build %python_build