Skip to main content

Produces a tox.ini file from a template config file.

The template config file is a standard tox.ini file with additional sections. Theses sections will be combined to create new testenv: sections if they do not exists yet.

The added sections are:

[axes]

options:

axis1name = value1(*)[,value2(*)[, ...]]
axis2name = value1(*)[,value2[, ...]]

In this section, a list of test axes are given and for each of them a list of possible values.

A tailing ‘*’ on a value means it is this axis default value. Hence it can be set on only one value. The default value will create additional sections with this axis value removed from the section name (see below)

Example:

To test a lib against different python version with and without ‘lxml’:

[axes]
python = py25,py32
lxml = lxml*,nolxml

This will generate the following [testenv:] sections:

[testenv:py25-lxml]
# ...

[testenv:py25]
# A copy of testenv:py25-lxml

[testenv:py25-nolxml]
# ...

[testenv:py32-lxml]
# ...

[testenv:py32]
# A copy of testenv:py27-lxml

[testenv:py32-nolxml]
# ...
[axis:name]

The default options for an axis.

Any option can be added, and if not overridden for a specific value, combined with the same option in the other axis

[axis:name:value]

Options for a specific axis value.

The only option that will be interpreted by gentox is ‘constraints’, a multi-lines option that allow to exclude other axis values.

For example, if we want not to test py25 without lxml:

[axis:lxml:nolxml]
constraints=
    !python:py25

The other options will be combined.

Complete example:

[tox]
envlist = py25-nolxml,py32

[axes]
python = py25,py32
lxml = lxml*,nolxml

[axis:python]
deps =
    six

[axis:python:py25]
basepython=python2.5

[axis:python:py32]
basepython=python3.2

[axis:lxml:nolxml]
constraints =
    !python:py25

[axis:lxml:lxml]
deps =
    lxml

This will generate the following tox file:

[tox]
envlist = py25-nolxml,py32

[testenv:py25-lxml]
deps =
    six
    lxml
basepython = python2.5

[testenv:py25]
deps =
    six
    lxml
basepython = python2.5

[testenv:py32-lxml]
deps =
    six
    lxml
basepython = python3.2

[testenv:py32]
deps =
    six
    lxml
basepython = python3.2

[testenv:py32-nolxml]
deps =
    six
basepython = python3.2

Running

Usage: toxgen.py [options]

Options:
  -h, --help            show this help message and exit
  -i FILE, --input=FILE
                        input template file to process [default: tox-tmpl.ini]
  -o FILE, --output=FILE
                        output file to generate [default: tox.ini]
  -r, --rewrite         rewrite [tox] envlist [default: False]

Produce a tox.ini file from a template config file.  The template config file
is a standard tox.ini file with additional sections. Theses sections will be
combined to create new testenv: sections if they do not exists yet.

Release files for toxgen 0.1

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

Source distribution (sdist)

Source distribution for toxgen 0.1
File Size Uploaded
toxgen-0.1.tar.gz 4.4 kB Details

Release files / toxgen-0.1.tar.gz

Download URL toxgen-0.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6aeefd1c54d732c3dec5c9fa89d4021594f86ce60d0f9cc46b93f4f36d65d7ad
BLAKE2b-256 checksum
How to use checksums
d0161bbf87c76f79163c7e101ed61143870cd7111e1b6bd7d13951fed7352b74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file

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