Tox.ini生成器
项目描述
从模板配置文件生成tox.ini文件。
模板配置文件是一个标准的tox.ini文件,包含额外的部分。如果这些部分不存在,将合并它们以创建新的testenv:部分。
添加的部分包括
- [axes]
选项
axis1name = value1(*)[,value2(*)[, ...]] axis2name = value1(*)[,value2[, ...]]
在这个部分中,给出了一组测试轴及其可能值的列表。
值末尾的‘*’表示它是此轴的默认值。因此,它只能设置在一个值上。默认值将创建具有此轴值删除的额外部分(见下文)
- 示例
测试一个库针对不同的Python版本(有和无‘lxml’)
[axes] python = py25,py32 lxml = lxml*,nolxml
这将生成以下[testenv:]部分
[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]
轴的默认选项。
任何选项都可以添加,如果没有为特定值覆盖,则与另一个轴中的相同选项组合
- [axis:name:value]
特定轴值的选项。
gentox将解释的唯一选项是‘constraints’,这是一个多行选项,允许排除其他轴值。
例如,如果我们想不测试py25而无需lxml
[axis:lxml:nolxml] constraints= !python:py25
其他选项将组合。
完整示例
[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
这将生成以下tox文件
[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
运行
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.
项目详情
关闭
toxgen-0.1.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 6aeefd1c54d732c3dec5c9fa89d4021594f86ce60d0f9cc46b93f4f36d65d7ad |
|
MD5 | 8a1d2278f3ecaf2f0b6309ea23c147f7 |
|
BLAKE2b-256 | d0161bbf87c76f79163c7e101ed61143870cd7111e1b6bd7d13951fed7352b74 |