在travis ci`.travis.yml`文件和tox`tox.ini`文件之间转换

panci的Python项目详细描述


https://secure.travis-ci.org/msabramo/python-panci.png

对于Python项目,获取一个.travis.yml文件(Travis CI)并输出 tox.ini文件(Tox)。反之亦然。

为什么叫这个名字?

“panci”这个名字是对John MacFarlane优秀的pandoc的敬意。 我已经用“ci”代替了“doc”;“ci”代表持续集成,这是一个广义的术语,用来表示Travis CITox对您有什么帮助。

安装

使用pip:

pip install panci

示例

travis到tox

假设我们有以下.travis.yml

language:pythonpython:-2.6-2.7-3.2-pypyscript:python setup.py test

如果我们运行:

panci --to=tox .travis.yml

然后我们得到:

# Tox (http://tox.testrun.org/) is a tool for running tests# in multiple virtualenvs. This configuration file will run the# test suite on all supported python versions. To use it, "pip install tox"# and then run "tox" from this directory.[tox]envlist=py26, py27, py32, pypy[testenv]commands=python setup.py test

毒性到特拉维斯

假设我们有以下tox.ini

[tox]envlist=py26, py27, py33, pypy[testenv]commands=py.testdeps=pytest

如果我们跑:

panci tox.ini

然后我们得到:

language:pythonenv:-TOXENV=py26-TOXENV=py27-TOXENV=py33-TOXENV=pypyinstall:-travis_retry pip install tox==1.6.1script:-travis_retry tox

panci tox快速启动

如果我们跑:

panci-tox-quickstart

然后会问您一些问题:

This utility will ask you a few questions and then generate a simple tox.ini
file to help get you started using tox.

Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).

> Test your project with py24 (Y/n) [Y]: n
> Test your project with py25 (Y/n) [Y]: n
> Test your project with py26 (Y/n) [Y]:
> Test your project with py27 (Y/n) [Y]:
> Test your project with py30 (Y/n) [Y]:
> Test your project with py31 (Y/n) [Y]:
> Test your project with py32 (Y/n) [Y]:
> Test your project with py33 (Y/n) [Y]:
> Test your project with pypy (Y/n) [Y]:
> Test your project with jython (Y/n) [Y]: n

What command should be used to test your project -- examples:
    - python setup.py test
    - nosetests package.module
    - trial package.module
> Command to run to test project [{envpython} setup.py test]:

What dependencies does your project have?
> Comma-separated list of dependencies [ ]: requests,nose

Creating file tox.ini.

Finished: A tox.ini file has been created.

Execute `tox` to test your project.

然后,一个tox.ini文件被弹出,其中包含:

# Tox (http://tox.testrun.org/) is a tool for running tests# in multiple virtualenvs. This configuration file will run the# test suite on all supported python versions. To use it, "pip install tox"# and then run "tox" from this directory.[tox]envlist=py26, py27, py30, py31, py32, py33, pypy[testenv]commands={envpython} setup.py testdeps=
    requests
    nose

关于panci-tox-quickstart的注意事项:我还将长期致力于获得 tox-quickstart命令合并到tox中。见this pull request

支持

有关问题、评论和建议,请使用GitHub Issues

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Android Studio gradle版本错误   odata如何使用SAP Cloud SDK 3.2.0在Java中检索目标?   具有包含地址的路径的java执行进程   java日志中充斥着AWS Http调用   java notifyDataSetChanged不使用线程   java Android位图:中心裁剪+创建位图的圆形   在解组Json对象时,java“prolog中不允许内容”   java getResources()来自Android Studio中的枚举   java EclipseLink相当于Hibernate@naturaid   java如何用相似但不同的对象填充列表?   xml java SAXParser忽略异常并继续解析   如何从java控制台运行控制台应用程序?   java如何通过一个jsp中的链接将注册表切换为登录表单(或其他方式)?   这可能是java/lang/Runtime的用法。exec([Ljava/lang/String;)Ljava/lang/Process;可能容易受到命令注入的攻击   java这本教科书中的链表是否包含“递归构造函数”?   java将Arraylist<Integer>转换为char[]的最佳方式是什么