From 28248c2d01151b10c7dca8e373ca621228c57a86 Mon Sep 17 00:00:00 2001 From: Elod Illes Date: Mon, 13 Feb 2023 17:45:13 +0100 Subject: [PATCH] Workaround for unittests Probably with the latest virtualenv [1] (which bundles setuptools), the unit tests started to fail with this error: File "/home/zuul/src/opendev.org/openstack/requirements/.tox/py310/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 37, in __init__ raise InvalidRequirement(str(e)) from e pkg_resources.extern.packaging.requirements.InvalidRequirement: Expected end or semicolon (after version specifier) lesscpy>=0.9h It seems that the parser have become more strict and now it does not accept other than 0.9a, 0.9b (alpha, beta) releases when parsing constraints. This patch updates the global requirements test file to not break the parser. Also the test_match_without_python3_markers test caused the same error (with: withmarker>=1.5') and needed an update. [1] virtualenv (20.19.0) released at Tue, 07 Feb 2023 20:16:53 GMT Change-Id: Ia2ba3f38a83216abc430ed754bb7d8cbe8c564d3 --- openstack_requirements/tests/files/gr-base.txt | 4 ++-- openstack_requirements/tests/test_check.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openstack_requirements/tests/files/gr-base.txt b/openstack_requirements/tests/files/gr-base.txt index 081a06fc6f..94f1060400 100644 --- a/openstack_requirements/tests/files/gr-base.txt +++ b/openstack_requirements/tests/files/gr-base.txt @@ -22,7 +22,7 @@ Jinja2 jsonrpclib jsonschema!=1.4.0,<2,>=1.0.0 kazoo>=0.9,<=1.1 -lesscpy>=0.9h +lesscpy>=0.10 kombu>=2.4.8 lockfile>=0.8 lxml>=2.3 @@ -59,7 +59,7 @@ python-neutronclient>=2.2.3,<3 python-novaclient>=2.12.0 python-swiftclient>=1.2 python-troveclient -pytz>=2010h +pytz>=2011b pyudev PyYAML>=3.1.0 qpid-python diff --git a/openstack_requirements/tests/test_check.py b/openstack_requirements/tests/test_check.py index e1eca3c17c..00af4504b4 100644 --- a/openstack_requirements/tests/test_check.py +++ b/openstack_requirements/tests/test_check.py @@ -66,7 +66,7 @@ class TestIsReqInGlobalReqs(testtools.TestCase): specify e.g. a "python_version>'3" marker for packages. """ req = requirement.parse(textwrap.dedent(""" - withmarker>=1.5' + withmarker>=1.5 """))['withmarker'][0][0] self.assertTrue( check._is_requirement_in_global_reqs(