diff options
author | Tzu-ping Chung <uranusjr@gmail.com> | 2021-02-28 22:16:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-28 22:16:28 +0800 |
commit | 550270c7ff4569ce24730af0662efc1bfc72d573 (patch) | |
tree | 3bfb04a2f096af6ba6973a18cf85b14be363bd22 | |
parent | 8223d29b3991945e8a4863429ee0f2757fc0cb70 (diff) | |
parent | 7b2548905db91b584b5f8a11e7d3c87bf807faae (diff) | |
download | pip-550270c7ff4569ce24730af0662efc1bfc72d573.tar.gz |
Merge pull request #9636 from dwt/master
-rw-r--r-- | news/4390.bugfix.rst | 1 | ||||
-rw-r--r-- | src/pip/_internal/utils/setuptools_build.py | 2 | ||||
-rw-r--r-- | tests/functional/test_install.py | 22 |
3 files changed, 24 insertions, 1 deletions
diff --git a/news/4390.bugfix.rst b/news/4390.bugfix.rst new file mode 100644 index 000000000..0d84de5cf --- /dev/null +++ b/news/4390.bugfix.rst @@ -0,0 +1 @@ +Fixed ``--target`` to work with ``--editable`` installs. diff --git a/src/pip/_internal/utils/setuptools_build.py b/src/pip/_internal/utils/setuptools_build.py index 1f1980dd3..e16deecd5 100644 --- a/src/pip/_internal/utils/setuptools_build.py +++ b/src/pip/_internal/utils/setuptools_build.py @@ -99,7 +99,7 @@ def make_setuptools_develop_args( if prefix: args += ["--prefix", prefix] if home is not None: - args += ["--home", home] + args += ["--install-dir", home] if use_user_site: args += ["--user", "--prefix="] diff --git a/tests/functional/test_install.py b/tests/functional/test_install.py index e474ff046..95d9b73aa 100644 --- a/tests/functional/test_install.py +++ b/tests/functional/test_install.py @@ -1065,6 +1065,28 @@ def test_install_editable_with_prefix(script): result.did_create(install_path) +@pytest.mark.network +def test_install_editable_with_target(script): + pkg_path = script.scratch_path / 'pkg' + pkg_path.mkdir() + pkg_path.joinpath("setup.py").write_text(textwrap.dedent(""" + from setuptools import setup + setup( + name='pkg', + install_requires=['watching_testrunner'] + ) + """)) + + target = script.scratch_path / 'target' + target.mkdir() + result = script.pip( + 'install', '--editable', pkg_path, '--target', target + ) + + result.did_create(script.scratch / 'target' / 'pkg.egg-link') + result.did_create(script.scratch / 'target' / 'watching_testrunner.py') + + def test_install_package_conflict_prefix_and_user(script, data): """ Test installing a package using pip install --prefix --user errors out |