Improve pip target override condition

This commit is contained in:
vzhestkov 2023-11-14 15:27:03 +01:00 committed by Daniel Wozniak
parent 9b5f047f98
commit 3ad2037a39

View file

@ -253,7 +253,6 @@ def _get_env_activate(bin_env):
def _find_req(link):
logger.info("_find_req -- link = %s", link)
with salt.utils.files.fopen(link) as fh_link:
@ -849,9 +848,11 @@ def install(
cmd.extend(["--build", build])
# Use VENV_PIP_TARGET environment variable value as target
# if set and no target specified on the function call
# if set and no target specified on the function call.
# Do not set target if bin_env specified, use default
# for specified binary environment or expect explicit target specification.
target_env = os.environ.get("VENV_PIP_TARGET", None)
if target is None and target_env is not None:
if target is None and target_env is not None and bin_env is None:
target = target_env
if target: