Skip to content

Commit 5b20593

Browse files
committed
source_dir is always set when building a wheel or for editables
It is a remnant of the `setup.py install` era, and we can safely assume it is always set.
1 parent 670cc63 commit 5b20593

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/pip/_internal/wheel_builder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ def _should_build(
5050
if req.is_wheel:
5151
return False
5252

53-
if not req.source_dir:
54-
return False
53+
assert req.source_dir
5554

5655
if req.editable:
5756
# we only build PEP 660 editable requirements

tests/unit/test_wheel_builder.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ class ReqMock:
6363
ReqMock(editable=True, use_pep517=True, supports_pyproject_editable=False),
6464
False,
6565
),
66-
# We don't build if there is no source dir (whatever that means!).
67-
(ReqMock(source_dir=None), False),
6866
# By default (i.e. when binaries are allowed), VCS requirements
6967
# should be built in install mode.
7068
(

0 commit comments

Comments
 (0)