skillfed

codemod-tox

Utilities for editing tox.ini

codemod-tox v0.5.4 182.9K downloads/30d#10,080 on PyPI0
Permissive license MIT Active released

What it is and what it does

codemod-tox is a utility library for programmatically reading and modifying tox.ini configuration files. It provides parsers for tox environment lists, individual environment definitions, and conditional dependency specifications, allowing you to construct, expand, and transform these configurations as Python objects rather than manipulating raw strings.

The library is designed for tools that need to analyze or rewrite tox configurations—such as linters, migration scripts, or test infrastructure generators. It has no runtime dependencies and installs with low friction. It requires Python 3.10 or later and follows semantic versioning with a commitment to rename on major version changes.

Use it for:

  • Automatically expand or filter tox environment matrices in CI/CD pipeline configuration scripts
  • Build linting or validation tools that need to parse and understand tox.ini structure
  • Generate or modify tox configurations programmatically in test infrastructure generators
  • Migrate or refactor tox configurations across multiple projects using codemod-style transformations
  • Analyze tox environment dependencies to detect conflicts or redundancies

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses and modifies tox.ini configuration strings, including environment lists, environment definitions, and conditional dependencies with support for expansion and transformation.

Yes, if you need to parse or modify tox.ini files programmatically. The package is actively maintained, has no dependencies, installs easily, carries a permissive MIT license, and requires only Python 3.10+. It is well-suited for build tools, CI scripts, and configuration management. Not necessary if you only read tox.ini manually or use tox itself without programmatic modification.

Install

codemod-tox on PyPI

pip

pip install codemod-tox

uv

uv add codemod-tox

poetry

poetry add codemod-tox

Installing codemod-tox

Before you install

Low friction install with no runtime dependencies. Active maintenance with recent release; last commit on 2026-04-16. Requires Python 3.10+.

License in practice

MIT license permits commercial and private use with minimal restrictions; attribution required.

Quickstart

from codemod_tox import ToxEnv, ToxEnvlist

# Parse and expand environment definitions
env = ToxEnv.parse("py37") | "py38"
print(list(env))  # ["py37", "py38"]

# Parse and transform environment lists
envlist = ToxEnvlist.parse("py37, style")
result = envlist.transform_matching(
    lambda x: x.startswith("py3"),
    lambda y: y | "py38"
)

Requires Python 3.10 or later.

Verify before relying

  • Whether the package handles all tox.ini syntax variations or only basic cases as described
  • Performance characteristics when processing large or complex tox configurations
  • API stability guarantees beyond the meanver/semver promise mentioned in the description

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 120 days since the last release
Last repo commit
First released
Downloads 182,940/month — #10,080 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: codemod_tox-0.5.4-py3-none-any.whl

Tags

tox.ini parsingtox configuration editingenvironment list manipulationtox envlist transformconditional tox dependenciestox config codemodparse tox environments
toxconfiguration-managementcodemod

More Build Tools packages