File tree Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change 23
23
from wheel .wheelfile import WheelFile
24
24
25
25
from .. import Command , __version__ , _shutil
26
+ from .._normalization import safer_name
26
27
from ..warnings import SetuptoolsDeprecationWarning
27
28
from .egg_info import egg_info as egg_info_cls
28
29
29
30
from distutils import log
30
31
31
32
32
- def safe_name (name : str ) -> str :
33
- """Convert an arbitrary string to a standard distribution name
34
- Any runs of non-alphanumeric/. characters are replaced with a single '-'.
35
- """
36
- return re .sub ("[^A-Za-z0-9.]+" , "-" , name )
37
-
38
-
39
33
def safe_version (version : str ) -> str :
40
34
"""
41
35
Convert an arbitrary string to a standard version string
@@ -133,16 +127,6 @@ def get_abi_tag() -> str | None:
133
127
return abi
134
128
135
129
136
- def safer_name (name : str ) -> str :
137
- return (
138
- # Per https://packaging.python.org/en/latest/specifications/name-normalization/#name-normalization
139
- re .sub (r"[-_.]+" , "-" , safe_name (name ))
140
- .lower ()
141
- # Per https://packaging.python.org/en/latest/specifications/binary-distribution-format/#escaping-and-unicode
142
- .replace ("-" , "_" )
143
- )
144
-
145
-
146
130
def safer_version (version : str ) -> str :
147
131
return safe_version (version ).replace ("-" , "_" )
148
132
You can’t perform that action at this time.
0 commit comments