Skip to content

Commit

Permalink
Forward HOME by default (#2907)
Browse files Browse the repository at this point in the history
fixes #2702
  • Loading branch information
gschaffner committed Jan 31, 2023
1 parent 4408cff commit f38cc3f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changelog/2702.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Forward ``HOME`` by default - by :user:`gschaffner`.
1 change: 1 addition & 0 deletions src/tox/tox_env/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def _default_pass_env(self) -> list[str]:
"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")
Expand Down
2 changes: 1 addition & 1 deletion tests/session/cmd/test_show_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 [])
Expand Down

0 comments on commit f38cc3f

Please sign in to comment.