summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanden Schaffner <gschaffner@pm.me>2023-01-31 12:34:34 -0800
committerGitHub <noreply@github.com>2023-01-31 12:34:34 -0800
commitf38cc3fc9be94c803765ce91b2b565503e54c772 (patch)
tree223114672fd66343b725ecb88b44cfc395178d36
parent4408cff65d72d5662e85da632e74154dfc030ef2 (diff)
downloadtox-git-f38cc3fc9be94c803765ce91b2b565503e54c772.tar.gz
Forward `HOME` by default (#2907)
fixes https://github.com/tox-dev/tox/issues/2702
-rw-r--r--docs/changelog/2702.bugfix.rst1
-rw-r--r--src/tox/tox_env/api.py1
-rw-r--r--tests/session/cmd/test_show_config.py2
3 files changed, 3 insertions, 1 deletions
diff --git a/docs/changelog/2702.bugfix.rst b/docs/changelog/2702.bugfix.rst
new file mode 100644
index 00000000..7f3e64ee
--- /dev/null
+++ b/docs/changelog/2702.bugfix.rst
@@ -0,0 +1 @@
+Forward ``HOME`` by default - by :user:`gschaffner`.
diff --git a/src/tox/tox_env/api.py b/src/tox/tox_env/api.py
index 1542a8fc..fcfc9e4b 100644
--- a/src/tox/tox_env/api.py
+++ b/src/tox/tox_env/api.py
@@ -218,6 +218,7 @@ class ToxEnv(ABC):
"CPPFLAGS", # C++ compiler flags
"LD_LIBRARY_PATH", # location of libs
"LDFLAGS", # linker flags
+ "HOME", # needed for `os.path.expanduser()` on non-Windows systems
]
if sys.stdout.isatty(): # if we're on a interactive shell pass on the TERM
env.append("TERM")
diff --git a/tests/session/cmd/test_show_config.py b/tests/session/cmd/test_show_config.py
index 9ef9f300..46a04246 100644
--- a/tests/session/cmd/test_show_config.py
+++ b/tests/session/cmd/test_show_config.py
@@ -117,7 +117,7 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
expected = (
["CC", "CCSHARED", "CFLAGS"]
+ (["COMSPEC"] if is_win else [])
- + ["CPPFLAGS", "CURL_CA_BUNDLE", "CXX", "LANG", "LANGUAGE", "LDFLAGS", "LD_LIBRARY_PATH"]
+ + ["CPPFLAGS", "CURL_CA_BUNDLE", "CXX", "HOME", "LANG", "LANGUAGE", "LDFLAGS", "LD_LIBRARY_PATH"]
+ (["MSYSTEM", "NUMBER_OF_PROCESSORS", "PATHEXT"] if is_win else [])
+ ["PIP_*", "PKG_CONFIG", "PKG_CONFIG_PATH", "PKG_CONFIG_SYSROOT_DIR"]
+ (["PROCESSOR_ARCHITECTURE"] if is_win else [])