Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix --target not working with --editable #9636

Merged
merged 4 commits into from
Feb 28, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/4390.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix --target to work with --editable installs.
dwt marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 1 deletion src/pip/_internal/utils/setuptools_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def make_setuptools_develop_args(
if prefix:
args += ["--prefix", prefix]
if home is not None:
args += ["--home", home]
# args += ["--home", home]
dwt marked this conversation as resolved.
Show resolved Hide resolved
args += ["--install-dir", home]

if use_user_site:
args += ["--user", "--prefix="]
Expand Down
22 changes: 22 additions & 0 deletions tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,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
Expand Down