Skip to content

Instantly share code, notes, and snippets.

@dominicrodger
Last active December 20, 2015 00:49
Show Gist options
  • Save dominicrodger/6044677 to your computer and use it in GitHub Desktop.
Save dominicrodger/6044677 to your computer and use it in GitHub Desktop.
Quick and hacky way of going from a tox.ini file to a .travis.yml file.
from tox._config import parseconfig
print "language: python"
print "python: 2.7"
print "env:"
for env in parseconfig(None, 'tox').envlist:
print " - TOX_ENV=%s" % env
print "install:"
print " - pip install tox"
print "script:"
print " - tox -e $TOX_ENV"
@dominicrodger
Copy link
Author

Use this from wherever your tox.ini file is to generate a .travis.yml file which will run one build per tox environment. Inspired by @Julian. Output looks a bit like this: https://github.com/dominicrodger/djohno/blob/master/.travis.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment