Skip to content

Commit 550270c

Browse files
authored
Merge pull request #9636 from dwt/master
2 parents 8223d29 + 7b25489 commit 550270c

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

news/4390.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed ``--target`` to work with ``--editable`` installs.

src/pip/_internal/utils/setuptools_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def make_setuptools_develop_args(
9999
if prefix:
100100
args += ["--prefix", prefix]
101101
if home is not None:
102-
args += ["--home", home]
102+
args += ["--install-dir", home]
103103

104104
if use_user_site:
105105
args += ["--user", "--prefix="]

tests/functional/test_install.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,28 @@ def test_install_editable_with_prefix(script):
10651065
result.did_create(install_path)
10661066

10671067

1068+
@pytest.mark.network
1069+
def test_install_editable_with_target(script):
1070+
pkg_path = script.scratch_path / 'pkg'
1071+
pkg_path.mkdir()
1072+
pkg_path.joinpath("setup.py").write_text(textwrap.dedent("""
1073+
from setuptools import setup
1074+
setup(
1075+
name='pkg',
1076+
install_requires=['watching_testrunner']
1077+
)
1078+
"""))
1079+
1080+
target = script.scratch_path / 'target'
1081+
target.mkdir()
1082+
result = script.pip(
1083+
'install', '--editable', pkg_path, '--target', target
1084+
)
1085+
1086+
result.did_create(script.scratch / 'target' / 'pkg.egg-link')
1087+
result.did_create(script.scratch / 'target' / 'watching_testrunner.py')
1088+
1089+
10681090
def test_install_package_conflict_prefix_and_user(script, data):
10691091
"""
10701092
Test installing a package using pip install --prefix --user errors out

0 commit comments

Comments
 (0)