Skip to content

Commit fd89669

Browse files
committed
Remove now redundant error detection
This specifier syntax check is now done by the packaging library.
1 parent 80ec609 commit fd89669

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/pip/_internal/req/constructors.py

+1-12
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def with_source(text: str) -> str:
338338

339339
def _parse_req_string(req_as_string: str) -> Requirement:
340340
try:
341-
req = get_requirement(req_as_string)
341+
return get_requirement(req_as_string)
342342
except InvalidRequirement:
343343
if os.path.sep in req_as_string:
344344
add_msg = "It looks like a path."
@@ -353,17 +353,6 @@ def _parse_req_string(req_as_string: str) -> Requirement:
353353
if add_msg:
354354
msg += f"\nHint: {add_msg}"
355355
raise InstallationError(msg)
356-
else:
357-
# Deprecate extras after specifiers: "name>=1.0[extras]"
358-
# This currently works by accident because _strip_extras() parses
359-
# any extras in the end of the string and those are saved in
360-
# RequirementParts
361-
for spec in req.specifier:
362-
spec_str = str(spec)
363-
if spec_str.endswith("]"):
364-
msg = f"Extras after version '{spec_str}'."
365-
raise InstallationError(msg)
366-
return req
367356

368357
if req_as_string is not None:
369358
req: Optional[Requirement] = _parse_req_string(req_as_string)

0 commit comments

Comments
 (0)