Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/13523.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Permit spaces between a filepath and extras in an install requirement.
2 changes: 1 addition & 1 deletion src/pip/_internal/req/constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _strip_extras(path: str) -> tuple[str, str | None]:
m = re.match(r"^(.+)(\[[^\]]+\])$", path)
extras = None
if m:
path_no_extras = m.group(1)
path_no_extras = m.group(1).rstrip()
extras = m.group(2)
else:
path_no_extras = path
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_req.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ def test_requirement_file(self) -> None:
("pkg [ext] == 1.0; python_version<='3.6'", "pkg==1.0"),
("pkg-all.allowed_chars0 ~= 2.0", "pkg-all.allowed_chars0~=2.0"),
("pkg-all.allowed_chars0 [ext] ~= 2.0", "pkg-all.allowed_chars0~=2.0"),
("simple-0.1-py2.py3-none-any.whl [ext]", "simple==0.1"),
],
)
def test_install_req_drop_extras(self, inp: str, out: str) -> None:
Expand Down
Loading