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
- Rename the "Package name normalization" specification into "Package
name grammar and normalization", to make it explicitly about the
format of valid names too.
- Link to this spec in the core metadata specification instead of
duplicating the part about valid names.
Copy file name to clipboardExpand all lines: source/specifications/name-normalization.rst
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,16 @@
1
-
.. _name-normalization:
1
+
======================================
2
+
Package name grammar and normalization
3
+
======================================
4
+
5
+
Project names obey a restricted format, and are "normalized" for use in various
6
+
contexts. This document describes what the valid project names are, and how
7
+
project names should be normalized.
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-grammar:
8
11
9
-
Valid non-normalized names
10
-
--------------------------
12
+
Name grammar
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