Skip to content

Conversation

daniilgankov
Copy link
Contributor

@daniilgankov daniilgankov commented Jul 31, 2025

A tox environment may have git+ssh dependencies or even direct ssh command calls. In non-interactive shell sessions (such as in CI tasks) the identity is often available only through ssh-agent to keep the private key in secret or because there is no way to enter the passphrase. SSH client is communicating with ssh-agent session through the socket opened on SSH_AUTH_SOCK. This variable must be passed in the tox environment to SSH client could work with the agent session from there. If there is an active agent in a shell session, it most likely implies that it will be used for every SSH client connection even in tox environments.

ssh-agent evaluation exports not only SSH_AUTH_SOCK but also SSH_AGENT_PID with agent's process identifier. This variable is necessary to control the agent which also may be done from within a tox environment.

I do not know if either ssh-agent is available on Windows or it works the same way as it does on Linux/MacOS, so I do not pass the variables.

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

@gaborbernat gaborbernat merged commit 9f2db71 into tox-dev:main Jul 31, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants