Use VENV_PIP_TARGET as a target for pkg.install

if set and no target specified on the call
This commit is contained in:
Victor Zhestkov 2022-05-20 12:55:04 +03:00 committed by Gareth J. Greenaway
parent ea431b2c2f
commit aaafe75759

View file

@ -847,6 +847,12 @@ def install(
if build:
cmd.extend(["--build", build])
# Use VENV_PIP_TARGET environment variable value as target
# if set and no target specified on the function call
target_env = os.environ.get("VENV_PIP_TARGET", None)
if target is None and target_env is not None:
target = target_env
if target:
cmd.extend(["--target", target])