Skip to content

Commit c01a023

Browse files
chipotpre-commit-ci[bot]gaborbernat
authored
Add NETRC to the default_pass_env list (#3410)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bernát Gábor <[email protected]>
1 parent 971e7da commit c01a023

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

docs/changelog/3410.feature.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add ``NETRC`` to the list of environment variables always passed through.

docs/config.rst

+5
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,11 @@ Base options
530530
- ✅
531531
- ✅
532532
- ✅
533+
* - NETRC
534+
- ✅
535+
- ✅
536+
- ✅
537+
533538

534539

535540
More environment variable-related information

src/tox/tox_env/api.py

+1
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def _default_pass_env(self) -> list[str]: # noqa: PLR6301
220220
"HOME", # needed for `os.path.expanduser()` on non-Windows systems
221221
"FORCE_COLOR", # force color output
222222
"NO_COLOR", # disable color output
223+
"NETRC", # used by pip and netrc modules
223224
]
224225
if sys.stdout.isatty(): # if we're on a interactive shell pass on the TERM
225226
env.append("TERM")

tests/session/cmd/test_show_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
126126
+ ["CPPFLAGS", "CURL_CA_BUNDLE", "CXX", "FORCE_COLOR", "HOME", "LANG"]
127127
+ ["LANGUAGE", "LDFLAGS", "LD_LIBRARY_PATH"]
128128
+ (["MSYSTEM"] if is_win else [])
129-
+ ["NO_COLOR"]
129+
+ ["NETRC", "NO_COLOR"]
130130
+ (["NUMBER_OF_PROCESSORS", "PATHEXT"] if is_win else [])
131131
+ ["PIP_*", "PKG_CONFIG", "PKG_CONFIG_PATH", "PKG_CONFIG_SYSROOT_DIR"]
132132
+ (["PROCESSOR_ARCHITECTURE"] if is_win else [])

0 commit comments

Comments
 (0)