Skip to content

Commit 315e69a

Browse files
committed
Pass ssh-agent variables by default
1 parent c28c4b1 commit 315e69a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

docs/config.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,14 @@ Base options
552552
- ✅
553553
- ✅
554554
- ✅
555+
* - SSH_AGENT_PID
556+
- ✅
557+
- ✅
558+
- ❌
559+
* - SSH_AUTH_SOCK
560+
- ✅
561+
- ✅
562+
- ❌
555563

556564
More environment variable-related information can be found in :ref:`environment variable substitutions`.
557565

src/tox/tox_env/api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ def _default_pass_env(self) -> list[str]: # noqa: PLR6301
267267
"TMPDIR", # temporary file location
268268
"NIX_LD", # nix-ld loader
269269
"NIX_LD_LIBRARY_PATH", # nix-ld library path
270+
"SSH_AGENT_PID", # ssh-agent process ID
271+
"SSH_AUTH_SOCK", # ssh-agent socket path
270272
],
271273
)
272274
return env

tests/session/cmd/test_show_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
136136
+ (["PROGRAMFILES"] if is_win else [])
137137
+ (["PROGRAMFILES(x86)"] if is_win else [])
138138
+ ["PYTHON_GIL", "REQUESTS_CA_BUNDLE", "SSL_CERT_FILE"]
139+
+ (["SSH_AGENT_PID", "SSH_AUTH_SOCK"] if not is_win else [])
139140
+ (["SYSTEMDRIVE", "SYSTEMROOT", "TEMP"] if is_win else [])
140141
+ (["TERM"] if stdout_is_atty else [])
141142
+ (["TMP", "USERPROFILE"] if is_win else ["TMPDIR"])

0 commit comments

Comments
 (0)