File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,17 +145,11 @@ def write_simple_api(publication):
145145
146146def 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
You can’t perform that action at this time.
0 commit comments