tox-gh
Seamless integration of tox into GitHub Actions.
What it is and what it does
tox-gh is a plugin for tox that bridges the gap between tox's local environment management and GitHub Actions' matrix-based parallelism. It reads a configuration section mapping Python versions to tox environments, detects which Python version is running in the current GitHub Actions job, and automatically selects the corresponding environments to run—eliminating the need to manually coordinate between your Actions matrix and your tox configuration.
The plugin works by intercepting tox's environment selection logic when running inside GitHub Actions (detected via the GITHUB_ACTIONS environment variable). You define a mapping in your tox configuration (tox.toml, tox.ini, or pyproject.toml) that says "on Python 3.13, run these environments; on Python 3.12, run those," and tox-gh handles the rest. It supports freethreaded Python builds, multiple environments per version, and explicit overrides via environment variables or command-line flags.
Use it for:
- Run different test suites (unit tests, type checking, linting) on each Python version without duplicating workflow logic
- Test against multiple Django or dependency versions in parallel by mapping factored environments to Python versions
- Automatically test freethreaded Python builds (3.13t, 3.14t) alongside standard CPython in the same matrix
- Reduce GitHub Actions job count by running multiple tox environments sequentially within a single job per Python version
- Migrate existing tox-based projects to GitHub Actions without rewriting test configuration
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
tox-gh automatically selects and runs the appropriate tox environments for each Python version in a GitHub Actions matrix, enabling parallel test execution across multiple workers.
Yes. tox-gh solves a real coordination problem between tox and GitHub Actions with zero security issues, active maintenance, and permissive licensing. Install it if you use tox for local testing and want to run the same environments in GitHub Actions without manual synchronization. The low install friction and recent activity make it a straightforward addition to any tox-based project.
Install
tox-gh on PyPI
pip
pip install tox-ghuv
uv add tox-ghpoetry
poetry add tox-ghInstalling tox-gh
Before you install
Low install friction with a pure Python wheel distribution. The package is actively maintained with a recent release and depends only on tox and typing-extensions, both standard tools in the Python testing ecosystem.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
Quickstart
# Install
pip install tox tox-gh
# Add to tox.toml:
[gh.python]
"3.13" = ["py313"]
"3.12" = ["py312"]
# In GitHub Actions workflow, run:
tox
Requires tox 4 with a tox.toml, tox.ini, or pyproject.toml configuration file; only activates when running inside GitHub Actions (detected via GITHUB_ACTIONS environment variable).
Verify before relying
- Whether tox-gh works with tox versions prior to 4.x, given the description mentions 'tox 4' as a prerequisite
- Performance characteristics when running dozens of environments across a matrix
- Compatibility with GitHub Actions runners other than ubuntu-latest
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — tox, typing-extensions |
| Maintenance | actively maintained — 24 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 113,266/month — #12,349 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tox_gh-1.8.0-py3-none-any.whl
Keywords: environments, isolated, testing, virtual
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
tox-gh-actionsA tox plugin that automatically detects and…
permissive · top 15,000 on PyPI
riotriot constructs isolated Python virtual…
permissive · top 15,000 on PyPI
tox-ansibleA tox plugin that orchestrates testing of…
permissive · top 15,000 on PyPI
tox-uvtox-uv replaces virtualenv and pip with uv in…
permissive · top 5,000 on PyPI
tox-uv-baretox-uv-bare is a tox plugin that replaces…
permissive · top 5,000 on PyPI
mozilla-repo-urlsParses and processes Mozilla repository URLs,…
copyleft · top 5,000 on PyPI
pytest-github-actions-annotate-failuresA pytest plugin that automatically annotates…
permissive · top 5,000 on PyPI
codemod-toxParses and modifies tox.ini configuration…
permissive · top 15,000 on PyPI
IxNetworkIxNetwork is a Python client library for…
permissive · top 15,000 on PyPI
noxNox automates testing across multiple Python…
permissive · top 5,000 on PyPI