Skip to content

Commit f24d5ce

Browse files
committed
Respect user-provided env_inherit
1 parent eb8c5eb commit f24d5ce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

python/private/pypi/pip_compile.bzl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ def pip_compile(
155155
}
156156

157157
env = kwargs.pop("env", {})
158+
env_inherit = kwargs.pop("env_inherit", [])
159+
proxy_variables = ["https_proxy", "http_proxy", "no_proxy", "HTTPS_PROXY", "HTTP_PROXY", "NO_PROXY"]
160+
161+
for var in proxy_variables:
162+
if var not in env_inherit:
163+
env_inherit.append(var)
158164

159165
py_binary(
160166
name = name + ".update",
@@ -177,7 +183,7 @@ def pip_compile(
177183
"@@platforms//os:windows": {"USERPROFILE": "Z:\\FakeSetuptoolsHomeDirectoryHack"},
178184
"//conditions:default": {},
179185
}) | env,
180-
env_inherit = ["https_proxy", "http_proxy", "no_proxy", "HTTPS_PROXY", "HTTP_PROXY", "NO_PROXY"],
186+
env_inherit = env_inherit,
181187
# kwargs could contain test-specific attributes like size
182188
**dict(attrs, **kwargs)
183189
)

0 commit comments

Comments
 (0)