From d23066e93b2737c3b846e2c6927dbbf1e87f634a Mon Sep 17 00:00:00 2001 From: Pichot Date: Wed, 16 Oct 2024 15:08:46 +0800 Subject: [PATCH 1/7] Update api.py Add NETRC to the list of default_pass_env. This is used by pip when downloading package from an index needing authentication. --- src/tox/tox_env/api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tox/tox_env/api.py b/src/tox/tox_env/api.py index b98ad3b0aa..c8836d4239 100644 --- a/src/tox/tox_env/api.py +++ b/src/tox/tox_env/api.py @@ -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") From c27007f6f591c4150e92fd0a7a06808d84a3bd38 Mon Sep 17 00:00:00 2001 From: Pichot Date: Wed, 16 Oct 2024 15:11:20 +0800 Subject: [PATCH 2/7] Update config.rst --- docs/config.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/config.rst b/docs/config.rst index 8e41a36b1e..ccb7ad6078 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -530,6 +530,11 @@ Base options - ✅ - ✅ - ✅ + * - NETRC + - ✅ + - ✅ + - ✅ + More environment variable-related information From 37660a1c740fa2f864447abf51f45c9c7c226da6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 07:35:02 +0000 Subject: [PATCH 3/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/config.rst | 2 +- src/tox/tox_env/api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index ccb7ad6078..e67dd79cca 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -534,7 +534,7 @@ Base options - ✅ - ✅ - ✅ - + More environment variable-related information diff --git a/src/tox/tox_env/api.py b/src/tox/tox_env/api.py index c8836d4239..bdf4a0b0f3 100644 --- a/src/tox/tox_env/api.py +++ b/src/tox/tox_env/api.py @@ -220,7 +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 + "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") From 4d878623cb280d87aa88e2fd663d3a5a0f52342d Mon Sep 17 00:00:00 2001 From: Pichot Date: Wed, 16 Oct 2024 16:56:52 +0800 Subject: [PATCH 4/7] Update test_show_config.py --- tests/session/cmd/test_show_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/session/cmd/test_show_config.py b/tests/session/cmd/test_show_config.py index a5015c260a..fbded36e07 100644 --- a/tests/session/cmd/test_show_config.py +++ b/tests/session/cmd/test_show_config.py @@ -124,7 +124,7 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty: + ["CC", "CCSHARED", "CFLAGS"] + (["COMSPEC"] if is_win else []) + ["CPPFLAGS", "CURL_CA_BUNDLE", "CXX", "FORCE_COLOR", "HOME", "LANG"] - + ["LANGUAGE", "LDFLAGS", "LD_LIBRARY_PATH"] + + ["LANGUAGE", "LDFLAGS", "LD_LIBRARY_PATH", "NETRC"] + (["MSYSTEM"] if is_win else []) + ["NO_COLOR"] + (["NUMBER_OF_PROCESSORS", "PATHEXT"] if is_win else []) From 261c877bc8146e5e90fdafb0cdfb17730a7b39d9 Mon Sep 17 00:00:00 2001 From: Pichot Date: Wed, 16 Oct 2024 17:17:17 +0800 Subject: [PATCH 5/7] Update test_show_config.py --- tests/session/cmd/test_show_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/session/cmd/test_show_config.py b/tests/session/cmd/test_show_config.py index fbded36e07..370b91f65d 100644 --- a/tests/session/cmd/test_show_config.py +++ b/tests/session/cmd/test_show_config.py @@ -124,9 +124,9 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty: + ["CC", "CCSHARED", "CFLAGS"] + (["COMSPEC"] if is_win else []) + ["CPPFLAGS", "CURL_CA_BUNDLE", "CXX", "FORCE_COLOR", "HOME", "LANG"] - + ["LANGUAGE", "LDFLAGS", "LD_LIBRARY_PATH", "NETRC"] + + ["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 []) From 4b85319c6046408eb50a56cf7582d5e889017701 Mon Sep 17 00:00:00 2001 From: Pichot Date: Thu, 17 Oct 2024 09:12:10 +0800 Subject: [PATCH 6/7] Create 3410.feature.rst --- docs/changelog/3410.feature.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/changelog/3410.feature.rst diff --git a/docs/changelog/3410.feature.rst b/docs/changelog/3410.feature.rst new file mode 100644 index 0000000000..4d911232b9 --- /dev/null +++ b/docs/changelog/3410.feature.rst @@ -0,0 +1 @@ +Add `NETRC` to the list of environment variables always passed through. From ed1a0984de9fabb8b204778a71f1fbc536d8547b Mon Sep 17 00:00:00 2001 From: Pichot Date: Thu, 17 Oct 2024 11:18:07 +0800 Subject: [PATCH 7/7] Update 3410.feature.rst (fix mistake with backticks) --- docs/changelog/3410.feature.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog/3410.feature.rst b/docs/changelog/3410.feature.rst index 4d911232b9..e07c6d4c22 100644 --- a/docs/changelog/3410.feature.rst +++ b/docs/changelog/3410.feature.rst @@ -1 +1 @@ -Add `NETRC` to the list of environment variables always passed through. +Add ``NETRC`` to the list of environment variables always passed through.