skillfed

tox-gh

Seamless integration of tox into GitHub Actions.

tox-gh v1.8.0 113.3K downloads/30d#12,349 on PyPI69
Permissive license MIT Active released

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-gh

uv

uv add tox-gh

poetry

poetry add tox-gh

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Topic :: InternetTopic :: Software Development :: LibrariesTopic :: System

Tags

tox github actions integrationparallel testing github actionspython version matrix testingtox environment selection automationci cd testing orchestrationgithub actions test runnermatrix job environment mapping
ci-cdgithub-actionstesting-automation

More Libraries packages