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.4.tar.gz (16.5 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.4-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: codemod_tox-0.5.4.tar.gz
  • Upload date:
  • Size: 16.5 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.4.tar.gz
Algorithm Hash digest
SHA256 3b5e92f71ce4745a30ff7c337bd7ca724db00071954595c761f4a2b2d79b01be
MD5 1c771ba8986d788516b2c8ab6b479248
BLAKE2b-256 a2c0e8bf4300520b72163f4c6432d49e271656a96c6583aa3a5b8daeca904b70

See more details on using hashes here.

Provenance

The following attestation bundles were made for codemod_tox-0.5.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: codemod_tox-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 12.2 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 66bf66b53b3cb1f5f541d9d41289d2b8092246b3249cb589babc4ae53ee5dc21
MD5 ede8f2e2f4b1c4b4870410a2b205a8ae
BLAKE2b-256 c1ca12a879e657639ba9f26812a716830168f47d27bad7e68c12876f430d7416

See more details on using hashes here.

Provenance

The following attestation bundles were made for codemod_tox-0.5.4-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