toxmatrix Package

toxmatrix Package

cli Module

tox-matrix

Usage:
tox-matrix generate (-d PACKAGE -v VERSION_STRINGS)... [-p PYVERSION]... [options] tox-matrix default
Options:

generate generate tox.ini file with given options default print default template

-h –help Show this screen. –version Show version. -d PACKAGE, –dep=PACKAGE Package name as a dependency.

-v VERSION_STRINGS, --ver=VERSION_STRINGS
 Comma seperated list of versions for the given package.
-p PYVERSION, --pyver=PYVERSION
 [default: 2.7 3.3] Python versions for basepython option (can be given multiple times)
--template=TEMPLATE
 A custom template (full path to a file) to generate a tox.ini file contents. Use default to print a default template.
--exact [default: False] Pin exact versions of packages.
toxmatrix.cli.generate_toxini_contents(arguments)[source]

prepare arguments and call generate_matrix and generate_tox_ini

toxmatrix.cli.main()[source]
toxmatrix.cli.print_default_template(arguments)[source]

just print a default template

lib Module

Module for generic helpers

toxmatrix.lib.generate_matrix(python_versions, packages, version_steps, pin_exact=False)[source]

returns a matrix of packages and its versions including different python versions

Parameters:
  • python_versions – iterable of python version strings e.g. (‘2.7’, ‘3.3’)
  • packages – iterable of package names e.g. (‘Django’, ‘Fabric’)
  • version_steps – iterable of iterables of version strings from above packages e.g. ((‘1.5’, ‘1.6’, ‘1.7’), (‘1.6’, ‘1.7’, ‘1.8’))
  • pin_exact

    defines whether to pin exactly above version.

    if True then use exact specified versions (e.g. to produce something like (‘Django==1.5’, ‘Django==1.6’, ‘Django==1.7’))

    if False then use specified versions as boundaries (e.g. to produce something like (‘Django>=1.5,<1.6’, ‘Django>=1.6,<1.7’)

Return list:

an iterable of two tuples e.g.:

[('python2.7', (
    ('Django>=1.5,<1.6', 'Fabric>=1.6,<1.7'),
    ('Django>=1.5,<1.6', 'Fabric>=1.7,<1.8'),
    ('Django>=1.6,<1.7', 'Fabric>=1.6,<1.7'),
    ('Django>=1.6,<1.7', 'Fabric>=1.7,<1.8'),
    )
  ),
 ('python3.3', (
    ('Django>=1.5,<1.6', 'Fabric>=1.6,<1.7'),
    ('Django>=1.5,<1.6', 'Fabric>=1.7,<1.8'),
    ('Django>=1.6,<1.7', 'Fabric>=1.6,<1.7'),
    ('Django>=1.6,<1.7', 'Fabric>=1.7,<1.8'),
    )
  ),
]
toxmatrix.lib.pin_version(package_name, version_steps, exact=False)[source]

create a tuple of strings with package and pinned versions.

Parameters:
  • package_name – package name to be pinned
  • version_steps – an iterable of versions for the given package name
  • exact – same as in generate_matrix

template Module

Module for creating tox.ini files

toxmatrix.template.generate_tox_ini(matrix, template=None)[source]

Generate a tox.ini file contents from a given matrix using a template

Parameters:
  • matrix – as returned from toxmatrix.lib.generate_matrix
  • template – a template to render tox.ini with Jinja2