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:
Joe Rickerby
2024-03-09 13:53:32 +00:00
committed by GitHub
4 changed files with 61 additions and 3 deletions
+5 -1
View File
@@ -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",
+6 -1
View File
@@ -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",