Skip to content

Commit 4f4ae38

Browse files
authored
Merge pull request #12744 from Ansud/main
2 parents 858a515 + f78bd81 commit 4f4ae38

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

news/8438.bugfix.rst

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
If the user's pip.conf includes a target directory setting,
2+
attempting to install a package in editable mode or from source
3+
results in a fatal error during the installation of setuptools.
4+
5+
The following assertion triggers:
6+
assert not (home and prefix), "home={} prefix={}".format(home, prefix)
7+
8+
To avoid this issue when building a package, the target
9+
setting should be ignored. This can be achieved by passing an empty
10+
target when installing dependencies in the BuildEnvironment class.

src/pip/_internal/build_env.py

+4
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ def _install_requirements(
242242
prefix.path,
243243
"--no-warn-script-location",
244244
"--disable-pip-version-check",
245+
# The prefix specified two lines above, thus
246+
# target from config file or env var should be ignored
247+
"--target",
248+
"",
245249
]
246250
if logger.getEffectiveLevel() <= logging.DEBUG:
247251
args.append("-vv")

0 commit comments

Comments
 (0)