Skip to content

Commit 7bcccbd

Browse files
committed
Canonicalise package name in tests.lib.create_basic_wheel_for_package
1 parent e40d267 commit 7bcccbd

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

news/FCD7E4ED-BA3E-4018-B43E-D445DA8E542B.trivial

Whitespace-only changes.

tests/lib/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,9 @@ def create_basic_wheel_for_package(
994994
if extra_files is None:
995995
extra_files = {}
996996

997+
# Fix wheel distribution name by replacing runs of non-alphanumeric
998+
# characters with an underscore _ as per PEP 491
999+
name = re.sub(r"[^\w\d.]+", "_", name, re.UNICODE)
9971000
archive_name = "{}-{}-py2.py3-none-any.whl".format(name, version)
9981001
archive_path = script.scratch_path / archive_name
9991002

0 commit comments

Comments
 (0)