Projects
openEuler:22.03:LTS:LoongArch
python-wheel
_service:tar_scm_kernel_repo:backport-Fixed-par...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm_kernel_repo:backport-Fixed-parsing-of-wheel-file-names-with-multiple-platform-tags.patch of Package python-wheel
From 44193907eb308930de05deed863fb4d157c5c866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= <alex.gronholm@nextday.fi> Date: Sat, 5 Nov 2022 01:17:22 +0200 Subject: [PATCH] Fixed parsing of wheel file names with multiple platform tags Reference:https://github.com/pypa/wheel/commit/44193907eb308930de05deed863fb4d157c5c866 Fixes #485. --- src/wheel/wheelfile.py | 4 ++-- tests/test_wheelfile.py | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/wheel/wheelfile.py b/src/wheel/wheelfile.py index 3c3d9f5..bce7ab3 100644 --- a/src/wheel/wheelfile.py +++ b/src/wheel/wheelfile.py @@ -16,8 +16,8 @@ from wheel.util import urlsafe_b64decode, as_unicode, native, urlsafe_b64encode, # Non-greedy matching of an optional build number may be too clever (more # invalid wheel filenames will match). Separate regex for .dist-info? WHEEL_INFO_RE = re.compile( - r"""^(?P<namever>(?P<name>[^-]+?)-(?P<ver>[^-]+?))(-(?P<build>\d[^-]*))? - -(?P<pyver>[^-]+?)-(?P<abi>[^-]+?)-(?P<plat>[^.]+?)\.whl$""", + r"""^(?P<namever>(?P<name>[^\s-]+?)-(?P<ver>[^\s-]+?))(-(?P<build>\d[^\s-]*))? + -(?P<pyver>[^\s-]+?)-(?P<abi>[^\s-]+?)-(?P<plat>\S+)\.whl$""", re.VERBOSE) diff --git a/tests/test_wheelfile.py b/tests/test_wheelfile.py index db11bcd..91e8aab 100644 --- a/tests/test_wheelfile.py +++ b/tests/test_wheelfile.py @@ -16,9 +16,16 @@ def wheel_path(tmpdir): return str(tmpdir.join('test-1.0-py2.py3-none-any.whl')) -def test_wheelfile_re(tmpdir): - # Regression test for #208 - path = tmpdir.join('foo-2-py3-none-any.whl') +@pytest.mark.parametrize( + "filename", + [ + "foo-2-py3-none-any.whl", + "foo-2-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", + ], +) +def test_wheelfile_re(filename, tmpdir): + # Regression test for #208 and #485 + path = tmpdir.join(filename) with WheelFile(str(path), 'w') as wf: assert wf.parsed_filename.group('namever') == 'foo-2' @@ -28,7 +35,8 @@ def test_wheelfile_re(tmpdir): 'test-1.0.whl', 'test-1.0-py2.whl', 'test-1.0-py2-none.whl', - 'test-1.0-py2-none-any' + 'test-1.0-py2-none-any', + "test-1.0-py 2-none-any.whl", ]) def test_bad_wheel_filename(filename): exc = pytest.raises(WheelError, WheelFile, filename) -- 2.33.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.