Skip to content

Commit

Permalink
Fix pip target with latest pip
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Sep 14, 2024
1 parent 518194c commit 79a2d70
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
12 changes: 9 additions & 3 deletions relenv/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,15 @@ def wrapper(
):
scheme = func(dist_name, user, home, root, isolated, prefix)
if TARGET.TARGET and TARGET.INSTALL:
scheme.platlib = TARGET.PATH
scheme.purelib = TARGET.PATH
scheme.data = TARGET.PATH
from pip._internal.models.scheme import Scheme

scheme = Scheme(
platlib=TARGET.PATH,
purelib=TARGET.PATH,
headers=scheme.headers,
scripts=scheme.scripts,
data=scheme.data,
)
return scheme

return wrapper
Expand Down
25 changes: 25 additions & 0 deletions tests/test_verify_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1322,3 +1322,28 @@ def test_install_m2crypto(pipexec, build, minor_version):
assert p.returncode == 0, "Failed install M2Crypto"
assert (extras / "M2Crypto").exists()
assert (extras / f"M2Crypto-{version}.dist-info").exists()


@pytest.mark.skip_unless_on_linux
def test_install_pyinotify_w_latest_pip(pipexec, build, minor_version):
p = subprocess.run(
[
str(pipexec),
"install",
"--upgrade",
"pip",
]
)
extras = build / "extras"
p = subprocess.run(
[
str(pipexec),
"install",
"--no-cache-dir",
"--no-binary=:all:",
f"--target={extras}",
"pyinotify",
]
)
assert p.returncode == 0, "Failed install pyinotify"
assert (extras / "pyinotify").exists()

0 comments on commit 79a2d70

Please sign in to comment.