Skip to main content

codemod-tox

Handles parsing and modifying some basic tox.ini configuration strings.

# ToxEnvlist.parse("py{37,38}, style")
envlist = py{37,38}, style

# ToxEnv.parse("foo")
[toxenv:foo]

# ToxConditional.parse("-rrequirements.txt\nflask: flask>0")
deps = -rrequirements.txt
       flask: flask>0

You can then do basic modifications on them, or expand by iterating.

>>> str(ToxEnv.parse("py37") | "py38")
"py3{7,8}"
>>> (ToxEnv.parse("py37") | "py38").startswith("py")
True
>>> list(ToxEnv.parse("py37") | "py38")
["py37", "py38"]
>>> str(ToxEnvlist.parse("py37, style").transform_matching(
...     (lambda x: x.startswith("py3")),
...     (lambda y: y | "py38"),
... ))
"py3{7,8}, style"

Version Compatibility

Python 3.10+.

Versioning

This library follows meanver which basically means semver along with a promise to rename when the major version changes.

Changelog

v0.5.5 – 2026-10-02

add_numeric_option will now put the new option after other numeric options that have the same alphabetic prefix. This helps keep true test environments in the same execution position relative to combining environments like "coverage".

License

codemod-tox is copyright Tim Hatch, and licensed under the MIT license. See the LICENSE file for details.

Maintenance

Running tests

Create a venv with make venv, then activate the venv and use make test.

Publishing

The library is published to PyPI with Trusted Publishing. To release the latest code:

  • Update the version and date in the changelog in README.md and commit the change.
  • Create and push a tag in the pattern vM.m.p like v1.2.3.
  • A GitHub action will publish to PyPI.

Metadata

Release files for codemod-tox 0.5.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codemod-tox 0.5.5
File Size Uploaded
codemod_tox-0.5.5.tar.gz 17.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for codemod-tox 0.5.5
File Interpreter ABI Platform
codemod_tox-0.5.5-py3-none-any.whl Python 3 none any Details

Total release size: 30.6 kB

Release files / codemod_tox-0.5.5.tar.gz

Download URL codemod_tox-0.5.5.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3dc4d49b16a539c074274cdb08c5ea7cbb6b6ea54cdd48506ceb7d9d962965e8
BLAKE2b-256 checksum
How to use checksums
99df52abf2d767a61837804556f706067b5c59fb786e2a068de99548268b93d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / codemod_tox-0.5.5-py3-none-any.whl

Download URL codemod_tox-0.5.5-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca2ef0e726bf2177e5abcaa1e54e2bfc329ad11c1e249098778a2629dfa483d6
BLAKE2b-256 checksum
How to use checksums
124b6f532ae2b6c61b97ec2aacd6d4bd5052033d007725c9a85e4857ab6360db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.5 This release

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page