Skip to content

Commit 197d3a1

Browse files
AlekseyLobanovSecrus
authored andcommitted
Fix wheel_file_re RegExp (python-poetry#9770)
1 parent cb046cd commit 197d3a1

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

src/poetry/utils/patterns.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55

66
wheel_file_re = re.compile(
7-
r"^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))"
8-
r"(-(?P<build>\d.*?))?"
9-
r"-(?P<pyver>.+?)"
10-
r"-(?P<abi>.+?)"
11-
r"-(?P<plat>.+?)"
12-
r"\.whl|\.dist-info$",
7+
r"^(?P<namever>(?P<name>.+?)-(?P<ver>\d[^-]*))"
8+
r"(-(?P<build>\d[^-]*))?"
9+
r"-(?P<pyver>[^-]+)"
10+
r"-(?P<abi>[^-]+)"
11+
r"-(?P<plat>[^-]+)"
12+
r"\.whl$",
1313
re.VERBOSE,
1414
)
1515

tests/utils/test_patterns.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@
3232
"plat": "manylinux2010_x86_64",
3333
},
3434
),
35+
(
36+
"isort-metadata-4.3.4-py2-none-any.whl",
37+
{
38+
"namever": "isort-metadata-4.3.4",
39+
"name": "isort-metadata",
40+
"ver": "4.3.4",
41+
"build": None,
42+
"pyver": "py2",
43+
"abi": "none",
44+
"plat": "any",
45+
},
46+
),
3547
],
3648
)
3749
def test_wheel_file_re(filename: str, expected: dict[str, str | None]) -> None:

0 commit comments

Comments
 (0)