Skip to content

Commit fe080e6

Browse files
committed
Change docstring after Warehouse switch
1 parent d3f4fdb commit fe080e6

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

pulp_python/app/tasks/publish.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,11 @@ def write_simple_api(publication):
145145

146146
def sanitize_name(name):
147147
"""
148-
As described by the reference doc, the canonical name for a python distribution is
149-
"all lowercase, with dashes replaced by underscores."
148+
Strips out all non-alphanumeric characters, including underscores, and replaces them with
149+
hyphens. Runs of multiple non-alphanumeric characters are replaced by only one hyphen.
150150
151-
https://wiki.python.org/moin/PyPISimple
152-
153-
That's not what PyPI/Warehouse actually do though. They strip out all other non-alphanumeric
154-
characters, including underscores, and replace them with hyphens. Runs of multiple
155-
non-alphanumeric characters are replaced by only one hyphen. Legacy PyPI neglects to strip
156-
period characters for the sanitized names as listed in the index, but it seems to also have
157-
shadow URLs with the same content but with the Warehouse-style name sanitization, and since
158-
this is what pip is actually using, we're doing it that way here.
151+
This is to take a given python package name and create an iteration of it that can be
152+
used as part of a url, e.g. for the simple api.
159153
160154
Args:
161155
name (str): A project name to sanitize

0 commit comments

Comments
 (0)