From 54552cdb75e31467cd614c3b0d0e1c1de4937c6e Mon Sep 17 00:00:00 2001 From: David Hotham Date: Thu, 21 Apr 2022 19:46:39 +0100 Subject: [PATCH] canonicalize package name correctly --- src/poetry/core/utils/helpers.py | 2 +- tests/utils/test_helpers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/poetry/core/utils/helpers.py b/src/poetry/core/utils/helpers.py index 50e5a223c..8b1f40d91 100644 --- a/src/poetry/core/utils/helpers.py +++ b/src/poetry/core/utils/helpers.py @@ -17,7 +17,7 @@ from poetry.core.version.pep440 import PEP440Version -_canonicalize_regex = re.compile(r"[-_]+") +_canonicalize_regex = re.compile(r"[-_.]+") def combine_unicode(string: str) -> str: diff --git a/tests/utils/test_helpers.py b/tests/utils/test_helpers.py index aef04d703..cd15de383 100644 --- a/tests/utils/test_helpers.py +++ b/tests/utils/test_helpers.py @@ -73,7 +73,7 @@ def test_parse_requires(): assert result == expected -@pytest.mark.parametrize("raw", ["a-b-c", "a_b-c", "a_b_c", "a-b_c"]) +@pytest.mark.parametrize("raw", ["a-b-c", "a_b-c", "a_b_c", "a-b_c", "a.b-c"]) def test_utils_helpers_canonical_names(raw: str): assert canonicalize_name(raw) == "a-b-c"