Merge pull request #1675 from pypa/pip-constraints-fix
fix: Don't override PIP_CONSTRAINT if set by the user
This commit is contained in:
@@ -407,7 +407,11 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
config.version
|
||||
)
|
||||
)
|
||||
build_env["PIP_CONSTRAINT"] = constraint_path.as_uri()
|
||||
user_constraints = build_env.get("PIP_CONSTRAINT")
|
||||
our_constraints = constraint_path.as_uri()
|
||||
build_env["PIP_CONSTRAINT"] = " ".join(
|
||||
c for c in [user_constraints, our_constraints] if c
|
||||
)
|
||||
build_env["VIRTUALENV_PIP"] = get_pip_version(env)
|
||||
call(
|
||||
"python",
|
||||
|
||||
@@ -443,7 +443,12 @@ def build(options: Options, tmp_path: Path) -> None:
|
||||
tmp_file.write_bytes(constraints_path.read_bytes())
|
||||
constraints_path = tmp_file
|
||||
|
||||
build_env["PIP_CONSTRAINT"] = str(constraints_path)
|
||||
our_constraints = str(constraints_path)
|
||||
user_constraints = build_env.get("PIP_CONSTRAINT")
|
||||
build_env["PIP_CONSTRAINT"] = " ".join(
|
||||
c for c in [our_constraints, user_constraints] if c
|
||||
)
|
||||
|
||||
build_env["VIRTUALENV_PIP"] = get_pip_version(env)
|
||||
call(
|
||||
"python",
|
||||
|
||||
Reference in New Issue
Block a user