mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Remove pip --prefix workaround (#74922)
Remove --prefix workaround See discussion in https://github.com/home-assistant/core/issues/74405. This workaround is no longer needed on pip >= 21.0 and actively causes problems for pip >= 21.3.
This commit is contained in:
parent
f6fd7d115e
commit
7d27dad190
@ -89,9 +89,6 @@ def install_package(
|
|||||||
# This only works if not running in venv
|
# This only works if not running in venv
|
||||||
args += ["--user"]
|
args += ["--user"]
|
||||||
env["PYTHONUSERBASE"] = os.path.abspath(target)
|
env["PYTHONUSERBASE"] = os.path.abspath(target)
|
||||||
# Workaround for incompatible prefix setting
|
|
||||||
# See http://stackoverflow.com/a/4495175
|
|
||||||
args += ["--prefix="]
|
|
||||||
_LOGGER.debug("Running pip command: args=%s", args)
|
_LOGGER.debug("Running pip command: args=%s", args)
|
||||||
with Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env) as process:
|
with Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env) as process:
|
||||||
_, stderr = process.communicate()
|
_, stderr = process.communicate()
|
||||||
|
@ -137,7 +137,6 @@ def test_install_target(mock_sys, mock_popen, mock_env_copy, mock_venv):
|
|||||||
"--quiet",
|
"--quiet",
|
||||||
TEST_NEW_REQ,
|
TEST_NEW_REQ,
|
||||||
"--user",
|
"--user",
|
||||||
"--prefix=",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
assert package.install_package(TEST_NEW_REQ, False, target=target)
|
assert package.install_package(TEST_NEW_REQ, False, target=target)
|
||||||
@ -156,7 +155,7 @@ def test_install_target_venv(mock_sys, mock_popen, mock_env_copy, mock_venv):
|
|||||||
|
|
||||||
|
|
||||||
def test_install_error(caplog, mock_sys, mock_popen, mock_venv):
|
def test_install_error(caplog, mock_sys, mock_popen, mock_venv):
|
||||||
"""Test an install with a target."""
|
"""Test an install that errors out."""
|
||||||
caplog.set_level(logging.WARNING)
|
caplog.set_level(logging.WARNING)
|
||||||
mock_popen.return_value.returncode = 1
|
mock_popen.return_value.returncode = 1
|
||||||
assert not package.install_package(TEST_NEW_REQ)
|
assert not package.install_package(TEST_NEW_REQ)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user