You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/specifications/name-normalization.rst
+19-11Lines changed: 19 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,16 @@
1
-
.. _name-normalization:
1
+
=======================
2
+
Names and normalization
3
+
=======================
4
+
5
+
This specification defines the format that names for packages and extras are
6
+
required to follow. It also describes how to normalize them, which should be
7
+
done before lookups and comparisons.
2
8
3
-
==========================
4
-
Package name normalization
5
-
==========================
6
9
7
-
Project names are "normalized" for use in various contexts. This document describes how project names should be normalized.
10
+
.. _name-format:
8
11
9
-
Valid non-normalized names
10
-
--------------------------
12
+
Name format
13
+
===========
11
14
12
15
A valid name consists only of ASCII letters and numbers, period,
13
16
underscore and hyphen. It must start and end with a letter or number.
@@ -16,10 +19,15 @@ following regex (run with ``re.IGNORECASE``)::
16
19
17
20
^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$
18
21
19
-
Normalization
20
-
-------------
21
22
22
-
The name should be lowercased with all runs of the characters ``.``, ``-``, or ``_`` replaced with a single ``-`` character. This can be implemented in Python with the re module:
23
+
.. _name-normalization:
24
+
25
+
Name normalization
26
+
==================
27
+
28
+
The name should be lowercased with all runs of the characters ``.``, ``-``, or
29
+
``_`` replaced with a single ``-`` character. This can be implemented in Python
30
+
with the re module:
23
31
24
32
.. code-block:: python
25
33
@@ -30,7 +38,7 @@ The name should be lowercased with all runs of the characters ``.``, ``-``, or `
30
38
31
39
This means that the following names are all equivalent:
0 commit comments