Skip to content

Commit

Permalink
Merge pull request #12744 from Ansud/main
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr authored Aug 22, 2024
2 parents 858a515 + f78bd81 commit 4f4ae38
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions news/8438.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
If the user's pip.conf includes a target directory setting,
attempting to install a package in editable mode or from source
results in a fatal error during the installation of setuptools.

The following assertion triggers:
assert not (home and prefix), "home={} prefix={}".format(home, prefix)

To avoid this issue when building a package, the target
setting should be ignored. This can be achieved by passing an empty
target when installing dependencies in the BuildEnvironment class.
4 changes: 4 additions & 0 deletions src/pip/_internal/build_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ def _install_requirements(
prefix.path,
"--no-warn-script-location",
"--disable-pip-version-check",
# The prefix specified two lines above, thus
# target from config file or env var should be ignored
"--target",
"",
]
if logger.getEffectiveLevel() <= logging.DEBUG:
args.append("-vv")
Expand Down

0 comments on commit 4f4ae38

Please sign in to comment.