Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pypi: fix name normalization rules #262

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions PURL-TYPES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -458,13 +458,13 @@ pypi
``pypi`` for Python packages:

- The default repository is ``https://pypi.org``. (Previously ``https://pypi.python.org``.)
- PyPI treats ``-`` and ``_`` as the same character and is not case sensitive.
Therefore a PyPI package ``name`` must be lowercased and underscore ``_``
replaced with a dash ``-``.
- Per `PEP 503 <https://peps.python.org/pep-0503/#normalized-names>`_, normalized PyPI package names should be
lowercased with all runs of the characters ``.``, ``-``, or ``_`` replaced with a single ``-`` character.
- Examples::

pkg:pypi/[email protected]
pkg:pypi/[email protected]
pkg:pypi/[email protected]

rpm
---
Expand Down
6 changes: 3 additions & 3 deletions test-suite-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@
},
{
"description": "pypi names have special rules and not case sensitive",
"purl": "pkg:PYPI/Django_package@1.11.1.dev1",
"canonical_purl": "pkg:pypi/django[email protected]",
"purl": "pkg:PYPI/My.PyPI_.--._Package@1.11.1.dev1",
"canonical_purl": "pkg:pypi/my-pypi[email protected]",
"type": "pypi",
"namespace": null,
"name": "django-package",
"name": "my-pypi-package",
"version": "1.11.1.dev1",
"qualifiers": null,
"subpath": null,
Expand Down