From 72062c1432f71f83eee7214986b955ba494ea7d1 Mon Sep 17 00:00:00 2001 From: Sam Martin Date: Mon, 17 Mar 2025 16:39:25 -0500 Subject: [PATCH 1/2] pass common proxy env vars to recipe env to fix pip build issues on corporate networks --- pythonforandroid/recipe.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pythonforandroid/recipe.py b/pythonforandroid/recipe.py index 44469aef2..b19d90b22 100644 --- a/pythonforandroid/recipe.py +++ b/pythonforandroid/recipe.py @@ -526,6 +526,11 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True): if arch is None: arch = self.filtered_archs[0] env = arch.get_env(with_flags_in_cc=with_flags_in_cc) + + for proxy_key in ['HTTP_PROXY', 'http_proxy', 'HTTPS_PROXY', 'https_proxy']: + if proxy_key in environ: + env[proxy_key] = environ[proxy_key] + return env def prebuild_arch(self, arch): From 0cce418d306dfe85ced198e3b1475c6ad7576e4f Mon Sep 17 00:00:00 2001 From: Sam Martin Date: Mon, 19 May 2025 09:41:16 -0500 Subject: [PATCH 2/2] remove whitespace on blank lines --- pythonforandroid/recipe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonforandroid/recipe.py b/pythonforandroid/recipe.py index b19d90b22..64630cc37 100644 --- a/pythonforandroid/recipe.py +++ b/pythonforandroid/recipe.py @@ -526,11 +526,11 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True): if arch is None: arch = self.filtered_archs[0] env = arch.get_env(with_flags_in_cc=with_flags_in_cc) - + for proxy_key in ['HTTP_PROXY', 'http_proxy', 'HTTPS_PROXY', 'https_proxy']: if proxy_key in environ: env[proxy_key] = environ[proxy_key] - + return env def prebuild_arch(self, arch):