Skip to content

Commit

Permalink
Add more c-extension env-vars to default pass_env
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Jan 4, 2023
1 parent a906a2a commit ea9689d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/tox/tox_env/api.py
Expand Up @@ -212,6 +212,8 @@ def _default_pass_env(self) -> list[str]:
"CURL_CA_BUNDLE", # curl certificates
"SSL_CERT_FILE", # https certificates
"LD_LIBRARY_PATH", # location of libs
"CC", # location of compiler
"CCSHARED", # location of compiler files
]
if sys.stdout.isatty(): # if we're on a interactive shell pass on the TERM
env.append("TERM")
Expand Down
3 changes: 2 additions & 1 deletion src/tox/tox_env/python/api.py
Expand Up @@ -118,7 +118,8 @@ def _default_pass_env(self) -> list[str]:
"NUMBER_OF_PROCESSORS", # multiprocessing.cpu_count()
],
)
env.extend(["PKG_CONFIG_PATH"]) # used by binary extensions during installation
binary_extension_build = ["PKG_CONFIG", "PKG_CONFIG_PATH", "PKG_CONFIG_SYSROOT_DIR"]
env.extend(binary_extension_build) # used by binary extensions during installation
env.extend(["REQUESTS_CA_BUNDLE"])
return env

Expand Down
5 changes: 3 additions & 2 deletions tests/session/cmd/test_show_config.py
Expand Up @@ -115,10 +115,11 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
pass_env = outcome.env_conf("py")["pass_env"]
is_win = sys.platform == "win32"
expected = (
(["COMSPEC"] if is_win else [])
["CC", "CCSHARED"]
+ (["COMSPEC"] if is_win else [])
+ ["CURL_CA_BUNDLE", "LANG", "LANGUAGE", "LD_LIBRARY_PATH"]
+ (["MSYSTEM", "NUMBER_OF_PROCESSORS", "PATHEXT"] if is_win else [])
+ ["PIP_*", "PKG_CONFIG_PATH"]
+ ["PIP_*", "PKG_CONFIG", "PKG_CONFIG_PATH", "PKG_CONFIG_SYSROOT_DIR"]
+ (["PROCESSOR_ARCHITECTURE"] if is_win else [])
+ (["PROGRAMDATA"] if is_win else [])
+ (["PROGRAMFILES"] if is_win else [])
Expand Down

0 comments on commit ea9689d

Please sign in to comment.