Skip to content

Commit

Permalink
Merge pull request #9 from chriskuehl/strip-whitespace
Browse files Browse the repository at this point in the history
Strip whitespace when normalizing package names
  • Loading branch information
chriskuehl authored May 15, 2024
2 parents b04fc6d + 7920cc5 commit 995cfc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ repos:
hooks:
- id: pyupgrade
args: ['--py38-plus']
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.4
- repo: https://github.com/hhatto/autopep8
rev: v2.1.0
hooks:
- id: autopep8
- repo: https://github.com/PyCQA/flake8
Expand Down
2 changes: 1 addition & 1 deletion pypi_browser/packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


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


class UnsupportedPackageType(Exception):
Expand Down

0 comments on commit 995cfc8

Please sign in to comment.