mirror of https://github.com/pypa/pip
Move extra conversion to function.
This commit is contained in:
parent
ec8bf2cc22
commit
0555261087
|
@ -74,6 +74,14 @@ def _strip_extras(path):
|
|||
return path_no_extras, extras
|
||||
|
||||
|
||||
def convert_extras(extras):
|
||||
# type: (Optional[str]) -> Set[str]
|
||||
if extras:
|
||||
return Requirement("placeholder" + extras.lower()).extras
|
||||
else:
|
||||
return set()
|
||||
|
||||
|
||||
def parse_editable(editable_req):
|
||||
# type: (str) -> Tuple[Optional[str], str, Optional[Set[str]]]
|
||||
"""Parses an editable requirement into:
|
||||
|
@ -332,10 +340,7 @@ def install_req_from_line(
|
|||
else:
|
||||
req_as_string = name
|
||||
|
||||
if extras_as_string:
|
||||
extras = Requirement("placeholder" + extras_as_string.lower()).extras
|
||||
else:
|
||||
extras = ()
|
||||
extras = convert_extras(extras_as_string)
|
||||
|
||||
def with_source(text):
|
||||
if not line_source:
|
||||
|
|
Loading…
Reference in New Issue