From 32914b024785db58d9770411edc926c25688cca4 Mon Sep 17 00:00:00 2001 From: "Dr. Jens Harbott" Date: Tue, 18 Jun 2024 07:52:07 +0200 Subject: [PATCH 1/2] Fix pkg_resources exception handling for py312 The exception that is generated on parsing errors has changed in Python 3.12, match on the generic ValueError instead. Also switch to using the simpler assertRaises() call instead of explicitly dealing with exceptions. Note that this is just a temporary workaround, we should really move away for using pkg_resources completely, see [0] and [1]. [0] https://setuptools.pypa.io/en/latest/pkg_resources.html [1] https://importlib-resources.readthedocs.io/en/latest/migration.html Change-Id: I20422194f6fc6d1c4ba49da754a2c3aab99a282c (cherry picked from commit c7d98564d0bf64e6fde26192c550f5200f267560) --- .../tests/test_requirement.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/openstack_requirements/tests/test_requirement.py b/openstack_requirements/tests/test_requirement.py index 52a5776fd..97c5130c2 100644 --- a/openstack_requirements/tests/test_requirement.py +++ b/openstack_requirements/tests/test_requirement.py @@ -12,8 +12,6 @@ import textwrap -import pkg_resources -import pkg_resources.extern.packaging.requirements as pkg_resources_reqs import testscenarios import testtools @@ -107,13 +105,7 @@ class TestParseRequirementFailures(testtools.TestCase): ('-f', dict(line='-f http://tarballs.openstack.org/'))] def test_does_not_parse(self): - try: - requirement.parse_line(self.line) - except (pkg_resources.RequirementParseError, - pkg_resources_reqs.InvalidRequirement): - pass - else: - self.fail('No exception triggered') + self.assertRaises(ValueError, requirement.parse_line, self.line) class TestToContent(testtools.TestCase): @@ -153,13 +145,8 @@ def test_urls(self): self.assertEqual(reqs, [(req, line)]) def test_not_urls(self): - try: - list(requirement.to_reqs('file:///foo#egg=foo')) - except (pkg_resources.RequirementParseError, - pkg_resources_reqs.InvalidRequirement): - pass - else: - self.fail('No exception triggered') + self.assertRaises( + ValueError, list, requirement.to_reqs('file:///foo#egg=foo')) def test_multiline(self): content = textwrap.dedent("""\ From 301f8414d2a3ca527fd5188114d1734eb4f8e4e8 Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Wed, 19 Jun 2024 18:39:05 +1000 Subject: [PATCH 2/2] Remove CentOS-8-Stream wheel jobs Change-Id: Id18a9f6e3918ea0e04783e599765a681c86c80a6 (cherry picked from commit ac0c1ffbe07fa9b56a7f86c51eb092ecefea557f) (cherry picked from commit 30f0fbd4d29b3336f8d02f47b48e02d891b6da2c) (cherry picked from commit 80ec66c043b3d095d8020a25f37a5882270e85c9) (cherry picked from commit d45da281158f0f6a2e780374701648a51de3d1a1) --- .zuul.d/project.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.zuul.d/project.yaml b/.zuul.d/project.yaml index a9e23c93c..15a555a83 100644 --- a/.zuul.d/project.yaml +++ b/.zuul.d/project.yaml @@ -3,9 +3,6 @@ - openstack-python3-yoga-jobs check: jobs: - - build-wheel-cache-centos-8-stream: - files: - - bindep.txt - build-wheel-cache-ubuntu-bionic: files: - bindep.txt @@ -52,9 +49,6 @@ files: - bindep.txt - upper-constraints.txt - - build-wheel-cache-centos-8-stream-arm64: - files: - - bindep.txt - build-wheel-cache-ubuntu-bionic-arm64: files: - bindep.txt @@ -63,9 +57,6 @@ - bindep.txt gate: jobs: - - build-wheel-cache-centos-8-stream: - files: - - bindep.txt - build-wheel-cache-ubuntu-bionic: files: - bindep.txt