Created
June 1, 2011 17:19
-
-
Save jacobian/1002792 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INI_HEADER = '''[tox] | |
setupdir = {toxinidir}/upstream | |
''' | |
ENV_TEMPLATE = '''[testenv:%(envname)s] | |
basepython = %(pyver)s | |
deps = %(deps)s | |
setenv = | |
PYTHONPATH={toxinidir} | |
commands = | |
{toxinidir}/upstream/tests/runtests.py --settings=%(settings)s [] | |
''' | |
PYTHONS = ['python2.5', 'python2.6', 'python2.7', 'pypy'] | |
DBENVS = { | |
'sqlite': {}, | |
'pg9': {'settings': 'postgres', 'deps': ['psycopg2']} | |
} | |
DEPS = ['Unipath'] | |
SKIP = ["python2.5-pg9", "pypy-pg9"] | |
print(INI_HEADER) | |
for pyver in PYTHONS: | |
for dbenv in DBENVS: | |
envname = "%s-%s" % (pyver, dbenv) | |
if envname in SKIP: | |
continue | |
dep_list = DEPS + DBENVS[dbenv].get('deps', []) | |
deps = "\n".join(" " + dep for dep in dep_list) | |
deps = "\n" + deps | |
settings = "testsettings.%s" % DBENVS[dbenv].get('settings', dbenv) | |
print(ENV_TEMPLATE % locals()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment