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.6 - 2026-10-09

A single-valued factor like {py312} used to cause an assert. This is now fixed.

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.6

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.6
File Size Uploaded Provenance Actions
codemod_tox-0.5.6.tar.gz 18.0 kB With provenance Details for codemod_tox-0.5.6.tar.gz

Built distribution (wheel)

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

Total release size: 31.0 kB

Release files / codemod_tox-0.5.6.tar.gz

Download URL codemod_tox-0.5.6.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f48f1fb688be302c50c98cd3e1d4b448a29d0396628468dd35b160d8a09876da
BLAKE2b-256 checksum
How to use checksums
e66190d32787c8055c5c300dbd4410ddafb49ccc17cd3c78ddf1e7691fb91a17
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 9, 2026.

Transparency log

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

Download URL codemod_tox-0.5.6-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2ab5f903b05452973b662b30900fec078aac67e7045575bd700fc76d8e1127d
BLAKE2b-256 checksum
How to use checksums
0320e937e84f7ec81498ea1b162047e15f2b62d1e7c8c7ef761bb575e381db22
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 9, 2026.

Transparency log

Security for codemod-tox 0.5.6

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for codemod_tox-0.5.6.tar.gz

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 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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