Skip to main content

Utilities for editing tox.ini

Project description

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.

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codemod_tox-0.5.3.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codemod_tox-0.5.3-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file codemod_tox-0.5.3.tar.gz.

File metadata

  • Download URL: codemod_tox-0.5.3.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codemod_tox-0.5.3.tar.gz
Algorithm Hash digest
SHA256 a8a60788599e336de5ac6f8502ebad8c17c20d7b357e5dc256c66b7b272525cf
MD5 1b12ada461e68c01dceb4427fb447111
BLAKE2b-256 7abf440e4e155859035b490a6829486d40236100c981f19fe4110a0270c4bce4

See more details on using hashes here.

Provenance

The following attestation bundles were made for codemod_tox-0.5.3.tar.gz:

Publisher: build.yml on advice-animal/codemod-tox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codemod_tox-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: codemod_tox-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codemod_tox-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b7673e0cf8e10db03f703c5dbaf91b952fd8037afa4c8347db3127c42b6beca4
MD5 35fc7f11535dc0eeb812b11cd02f088f
BLAKE2b-256 a4643908959f3db19d107c920a390796a0ce17347f19e43094c6f688fe244e40

See more details on using hashes here.

Provenance

The following attestation bundles were made for codemod_tox-0.5.3-py3-none-any.whl:

Publisher: build.yml on advice-animal/codemod-tox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page