Skip to content

Commit

Permalink
Allow the proxies in requests download
Browse files Browse the repository at this point in the history
  • Loading branch information
grammy-jiang authored and zsimic committed Apr 9, 2024
1 parent 75b47e5 commit d01d8ce
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/portable_python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,14 @@ def compile(self):
basename = runez.basename(self.url, extension_marker="#")
path = self.setup.folders.sources / basename
if not path.exists():
RestClient().download(self.url, path)
proxies = {}
http_proxy = os.environ.get("HTTP_PROXY") or os.environ.get("http_proxy")
if http_proxy:
proxies["http"] = http_proxy
https_proxy = os.environ.get("HTTPS_PROXY") or os.environ.get("https_proxy")
if https_proxy:
proxies["https"] = https_proxy
RestClient().download(self.url, path, proxies=proxies)

runez.decompress(path, self.m_src_build, simplify=True)

Expand Down

0 comments on commit d01d8ce

Please sign in to comment.