Skip to content

Commit

Permalink
Add NETRC to the default_pass_env list (#3410)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
  • Loading branch information
3 people authored Oct 17, 2024
1 parent 971e7da commit c01a023
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changelog/3410.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add ``NETRC`` to the list of environment variables always passed through.
5 changes: 5 additions & 0 deletions docs/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,11 @@ Base options
- ✅
- ✅
- ✅
* - NETRC
- ✅
- ✅
- ✅



More environment variable-related information
Expand Down
1 change: 1 addition & 0 deletions src/tox/tox_env/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def _default_pass_env(self) -> list[str]: # noqa: PLR6301
"HOME", # needed for `os.path.expanduser()` on non-Windows systems
"FORCE_COLOR", # force color output
"NO_COLOR", # disable color output
"NETRC", # used by pip and netrc modules
]
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 @@ -126,7 +126,7 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
+ ["CPPFLAGS", "CURL_CA_BUNDLE", "CXX", "FORCE_COLOR", "HOME", "LANG"]
+ ["LANGUAGE", "LDFLAGS", "LD_LIBRARY_PATH"]
+ (["MSYSTEM"] if is_win else [])
+ ["NO_COLOR"]
+ ["NETRC", "NO_COLOR"]
+ (["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 c01a023

Please sign in to comment.