From cd75d29ce3ca6f8120700d6a3e8aa4321a459951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Tue, 13 Dec 2022 07:59:55 -0800 Subject: [PATCH] Add PKG_CONFIG_PATH to default passenv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- docs/changelog/2700.feature.rst | 2 ++ src/tox/tox_env/python/api.py | 1 + tests/session/cmd/test_show_config.py | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 docs/changelog/2700.feature.rst diff --git a/docs/changelog/2700.feature.rst b/docs/changelog/2700.feature.rst new file mode 100644 index 000000000..671b489e6 --- /dev/null +++ b/docs/changelog/2700.feature.rst @@ -0,0 +1,2 @@ +Add ``PKG_CONFIG_PATH`` to the default pass through environment list for python tox environments - +by :user:`gaborbernat`. diff --git a/src/tox/tox_env/python/api.py b/src/tox/tox_env/python/api.py index b55068b42..09975569e 100644 --- a/src/tox/tox_env/python/api.py +++ b/src/tox/tox_env/python/api.py @@ -97,6 +97,7 @@ def _default_pass_env(self) -> list[str]: "NUMBER_OF_PROCESSORS", # multiprocessing.cpu_count() ], ) + env.extend(["PKG_CONFIG_PATH"]) # used by binary extensions during installation env.extend(["REQUESTS_CA_BUNDLE"]) return env diff --git a/tests/session/cmd/test_show_config.py b/tests/session/cmd/test_show_config.py index 7e6c1cff4..e392adef5 100644 --- a/tests/session/cmd/test_show_config.py +++ b/tests/session/cmd/test_show_config.py @@ -106,7 +106,7 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty: + (["PROGRAMDATA"] if is_win else []) + (["PROGRAMFILES"] if is_win else []) + (["PROGRAMFILES(x86)"] if is_win else []) - + ["REQUESTS_CA_BUNDLE", "SSL_CERT_FILE"] + + ["PKG_CONFIG_PATH", "REQUESTS_CA_BUNDLE", "SSL_CERT_FILE"] + (["SYSTEMDRIVE", "SYSTEMROOT", "TEMP"] if is_win else []) + (["TERM"] if stdout_is_atty else []) + (["TMP", "USERPROFILE"] if is_win else ["TMPDIR"])