diff --git a/src/pkgcheck/checks/python.py b/src/pkgcheck/checks/python.py index bacbdb5af..392241b25 100644 --- a/src/pkgcheck/checks/python.py +++ b/src/pkgcheck/checks/python.py @@ -946,5 +946,5 @@ def normalize(project: str) -> str: return PROJECT_SYMBOL_NORMALIZE_RE.sub("-", project).lower() pypi_name = pypi_remotes[0].name - if normalize(pkg.package) != normalize(pypi_name): - yield PythonMismatchedPackageName(pypi_name.replace(".", "-"), pkg=pkg) + if pkg.package != normalize(pypi_name): + yield PythonMismatchedPackageName(normalize(pypi_name), pkg=pkg) diff --git a/testdata/data/repos/python/PythonPackageNameCheck/PythonMismatchedPackageName/expected.json b/testdata/data/repos/python/PythonPackageNameCheck/PythonMismatchedPackageName/expected.json index 3c85ada51..5142f6a89 100644 --- a/testdata/data/repos/python/PythonPackageNameCheck/PythonMismatchedPackageName/expected.json +++ b/testdata/data/repos/python/PythonPackageNameCheck/PythonMismatchedPackageName/expected.json @@ -1 +1,2 @@ -{"__class__": "PythonMismatchedPackageName", "category": "dev-python", "package": "PythonMismatchedPackageName1", "recommended": "MismatchedPackageName1"} +{"__class__": "PythonMismatchedPackageName", "category": "dev-python", "package": "PythonMismatchedPackageName0", "recommended": "pythonmismatchedpackagename0"} +{"__class__": "PythonMismatchedPackageName", "category": "dev-python", "package": "PythonMismatchedPackageName1", "recommended": "mismatchedpackagename1"}