commit: eeee8f39dd01df91dd64c33f54b2c95ae3bcc337 Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Mon Feb 13 07:03:36 2023 +0000 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> CommitDate: Wed Feb 15 17:49:27 2023 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=eeee8f39
python: Use a more generic name for the project normalization regex Do not reference PEP 503 in the project name normalization regex. The same regex will be used for other kinds of project name normalization, notably wheel and sdist normalization. Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> src/pkgcheck/checks/python.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkgcheck/checks/python.py b/src/pkgcheck/checks/python.py index 29b3db8e..7cff5f12 100644 --- a/src/pkgcheck/checks/python.py +++ b/src/pkgcheck/checks/python.py @@ -25,7 +25,7 @@ GITHUB_ARCHIVE_RE = re.compile(r"^https://github\.com/[^/]+/[^/]+/archive/") SNAPSHOT_RE = re.compile(r"[a-fA-F0-9]{40}\.tar\.gz$") USE_FLAGS_PYTHON_USEDEP = re.compile(r"\[(.+,)?\$\{PYTHON_USEDEP\}(,.+)?\]$") -PEP503_SYMBOL_NORMALIZE_RE = re.compile(r"[-_.]+") +PROJECT_SYMBOL_NORMALIZE_RE = re.compile(r"[-_.]+") def get_python_eclass(pkg): @@ -768,7 +768,7 @@ class PythonPackageNameCheck(Check): https://peps.python.org/pep-0503/#normalized-names """ - return PEP503_SYMBOL_NORMALIZE_RE.sub("-", project).lower() + return PROJECT_SYMBOL_NORMALIZE_RE.sub("-", project).lower() pypi_name = pypi_remotes[0].name if normalize(pkg.package) != normalize(pypi_name):
