Skip to content

Commit f38cc3f

Browse files
authored
Forward HOME by default (#2907)
fixes #2702
1 parent 4408cff commit f38cc3f

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

docs/changelog/2702.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Forward ``HOME`` by default - by :user:`gschaffner`.

src/tox/tox_env/api.py

+1
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ def _default_pass_env(self) -> list[str]:
218218
"CPPFLAGS", # C++ compiler flags
219219
"LD_LIBRARY_PATH", # location of libs
220220
"LDFLAGS", # linker flags
221+
"HOME", # needed for `os.path.expanduser()` on non-Windows systems
221222
]
222223
if sys.stdout.isatty(): # if we're on a interactive shell pass on the TERM
223224
env.append("TERM")

tests/session/cmd/test_show_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
117117
expected = (
118118
["CC", "CCSHARED", "CFLAGS"]
119119
+ (["COMSPEC"] if is_win else [])
120-
+ ["CPPFLAGS", "CURL_CA_BUNDLE", "CXX", "LANG", "LANGUAGE", "LDFLAGS", "LD_LIBRARY_PATH"]
120+
+ ["CPPFLAGS", "CURL_CA_BUNDLE", "CXX", "HOME", "LANG", "LANGUAGE", "LDFLAGS", "LD_LIBRARY_PATH"]
121121
+ (["MSYSTEM", "NUMBER_OF_PROCESSORS", "PATHEXT"] if is_win else [])
122122
+ ["PIP_*", "PKG_CONFIG", "PKG_CONFIG_PATH", "PKG_CONFIG_SYSROOT_DIR"]
123123
+ (["PROCESSOR_ARCHITECTURE"] if is_win else [])

0 commit comments

Comments
 (0)