File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change 1
1
import functools
2
2
import logging
3
- import re
4
- from typing import NewType , Optional , Tuple , cast
3
+ from typing import Optional , Tuple
5
4
6
5
from pip ._vendor .packaging import specifiers , version
7
6
from pip ._vendor .packaging .requirements import Requirement
8
7
9
- NormalizedExtra = NewType ("NormalizedExtra" , str )
10
-
11
8
logger = logging .getLogger (__name__ )
12
9
13
10
@@ -44,15 +41,3 @@ def get_requirement(req_string: str) -> Requirement:
44
41
# minimize repeated parsing of the same string to construct equivalent
45
42
# Requirement objects.
46
43
return Requirement (req_string )
47
-
48
-
49
- def safe_extra (extra : str ) -> NormalizedExtra :
50
- """Convert an arbitrary string to a standard 'extra' name
51
-
52
- Any runs of non-alphanumeric characters are replaced with a single '_',
53
- and the result is always lowercased.
54
-
55
- This function is duplicated from ``pkg_resources``. Note that this is not
56
- the same to either ``canonicalize_name`` or ``_egg_link_name``.
57
- """
58
- return cast (NormalizedExtra , re .sub ("[^A-Za-z0-9.-]+" , "_" , extra ).lower ())
You can’t perform that action at this time.
0 commit comments