Skip to content

Commit 995cfc8

Browse files
authored
Merge pull request #9 from chriskuehl/strip-whitespace
Strip whitespace when normalizing package names
2 parents b04fc6d + 7920cc5 commit 995cfc8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ repos:
2525
hooks:
2626
- id: pyupgrade
2727
args: ['--py38-plus']
28-
- repo: https://github.com/pre-commit/mirrors-autopep8
29-
rev: v2.0.4
28+
- repo: https://github.com/hhatto/autopep8
29+
rev: v2.1.0
3030
hooks:
3131
- id: autopep8
3232
- repo: https://github.com/PyCQA/flake8

pypi_browser/packaging.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
def pep426_normalize(package_name: str) -> str:
16-
return re.sub(r'[-_.]+', '-', package_name).lower()
16+
return re.sub(r'[-_.]+', '-', package_name.strip()).lower()
1717

1818

1919
class UnsupportedPackageType(Exception):

0 commit comments

Comments
 (0)