Skip to main content

Convert between Travis-CI `.travis.yml` files and Tox `tox.ini` files

Project description

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

For a Python project, take a .travis.yml file (Travis CI) and output a tox.ini file (Tox). Or vice-versa.

Why the name?

The name “panci” is an homage to John MacFarlane’s excellent pandoc. I’ve replaced the “doc” with “ci”; “CI” stands for Continuous Integration, a broad term for what Travis CI and Tox help you with.

Installing

With pip:

pip install panci

Example

Travis to Tox

Let’s say that we have the following .travis.yml:

language: python

python:
  - 2.6
  - 2.7
  - 3.2
  - pypy

script: python setup.py test

If we run:

panci --to=tox .travis.yml

Then we get:

# 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 to Travis

Let’s say that we have the following tox.ini:

[tox]
envlist = py26, py27, py33, pypy

[testenv]
commands = py.test
deps = pytest

If we run:

panci tox.ini

Then we get:

language: python
env:
  - TOXENV=py26
  - TOXENV=py27
  - TOXENV=py33
  - TOXENV=pypy
install:
  - travis_retry pip install tox==1.6.1
script:
  - travis_retry tox

panci-tox-quickstart

If we run:

panci-tox-quickstart

Then you are asked some questions:

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.

And then a tox.ini file is spit out with:

# 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 test
deps =
    requests
    nose

Note about panci-tox-quickstart: I am also working longer-term on getting a tox-quickstart command merged into tox. See this pull request.

Support

For questions, comments, and suggestions, please use GitHub Issues.

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

panci-0.0.2.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

panci-0.0.2-py2.py3-none-any.whl (12.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file panci-0.0.2.tar.gz.

File metadata

  • Download URL: panci-0.0.2.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.6

File hashes

Hashes for panci-0.0.2.tar.gz
Algorithm Hash digest
SHA256 daab1afa3be2273ffd9bdae0750326cafa0ecaebfe75c6670880f3921383c244
MD5 53ff77ddc84863153e01c64f47589d66
BLAKE2b-256 1bfd4a8f02b77810ccebb4ced186883613293a1b8a1a28fd0da52bbf161cd5ac

See more details on using hashes here.

File details

Details for the file panci-0.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: panci-0.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.6

File hashes

Hashes for panci-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 62b6b7ba5a8219e385280e2f8dfb63474c61030d301da352f23a707dbf5456d6
MD5 a3ebcb2b9d4e5d63fe0b2c0ff96cd585
BLAKE2b-256 f5575e634fa003be9ac93d027196564ccf2e4afc3d69143bd6c23c11d7419784

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page