xref: /sqlalchemy/tox.ini (revision 49dfeda6)
16b051503SMike Bayer
29281e700SMike Bayer[tox]
3d100bfcfSMike Bayerenvlist =
4d100bfcfSMike Bayer  py{26,27,34,35}-{cext,nocext}-{default,sqlitepg,mysql,oracle,mssql},
5d100bfcfSMike Bayer  py27-nocext-cov,
6d100bfcfSMike Bayer  py27-cext-cov,
7d100bfcfSMike Bayer  py35-nocext-cov
89281e700SMike Bayer
99281e700SMike Bayer[testenv]
1049dfeda6SMike Bayer# note that we have a .coveragerc file that points coverage specifically
1149dfeda6SMike Bayer# at ./lib/sqlalchemy, and *not* at the build that tox might create under .tox.
1249dfeda6SMike Bayer# See the notes below for setenv for more detail.
1349dfeda6SMike Bayer# also using --cov-append so that we can aggregate multiple runs together.
1449dfeda6SMike Bayer# Jenkins etc. need to call "coverage erase" externally.
1549dfeda6SMike Bayercov_args=--cov=sqlalchemy --cov-report term --cov-append --cov-report xml --exclude-tag memory-intensive --exclude-tag timing-intensive -k "not aaa_profiling"
1649dfeda6SMike Bayer
1749dfeda6SMike Bayerusedevelop={env:USEDEVELOP}
18d100bfcfSMike Bayer
199281e700SMike Bayerdeps=pytest
206b051503SMike Bayer     pytest-xdist
219281e700SMike Bayer     mock
22d100bfcfSMike Bayer     sqlitepg: .[postgresql]
23d100bfcfSMike Bayer     mysql: .[mysql]
24d100bfcfSMike Bayer     mysql: .[pymysql]
25d100bfcfSMike Bayer     oracle: .[oracle]
26d100bfcfSMike Bayer     mssql: .[pyodbc]
27d100bfcfSMike Bayer     mssql: .[pymssql]
28d100bfcfSMike Bayer     cov: pytest-cov
29d100bfcfSMike Bayer     cov: .[mysql]
30d100bfcfSMike Bayer     cov: .[postgresql]
319281e700SMike Bayer
3249dfeda6SMike Bayerwhitelist_externals=sh
3349dfeda6SMike Bayer
3449dfeda6SMike Bayer# PYTHONPATH - erased so that we use the build that's present
3549dfeda6SMike Bayer# in .tox as the SQLAlchemy library to be imported
3649dfeda6SMike Bayer#
3749dfeda6SMike Bayer# PYTHONUSERSITE - this *MUST* be set so that the ./lib/ import
3849dfeda6SMike Bayer# set up explicitly in test/conftest.py is *disabled*, again so that
3949dfeda6SMike Bayer# when SQLAlchemy is built into the .tox area, we use that and not the
4049dfeda6SMike Bayer# local checkout, at least when usedevelop=False
4149dfeda6SMike Bayer#
4249dfeda6SMike Bayer# BASECOMMAND - using an env variable here so we can use it
4349dfeda6SMike Bayer# as a substitution in a command (see https://bitbucket.org/hpk42/tox/issues/307/)
4449dfeda6SMike Bayer#
4549dfeda6SMike Bayer# USEDEVELOP - also an env variable because we can't otherwise use a factor
4649dfeda6SMike Bayer# to control the value of the "usedevelop" setting (should also be a tox bug)
4749dfeda6SMike Bayer# We want develop=True when coverage is in play, because coverage is
4849dfeda6SMike Bayer# always against the files physically in ./lib.  We are doing an aggregate
4949dfeda6SMike Bayer# of coverage into one file across multiple test runs.
5049dfeda6SMike Bayer#
51f30e35baSMike Bayersetenv=
52f30e35baSMike Bayer    PYTHONPATH=
5349dfeda6SMike Bayer    PYTHONNOUSERSITE=1
5449dfeda6SMike Bayer    USEDEVELOP=False
550ad55992SMike Bayer    nocext: DISABLE_SQLALCHEMY_CEXT=1
56d100bfcfSMike Bayer    BASECOMMAND=python -m pytest -n4 --dropfirst
5749dfeda6SMike Bayer    cov: BASECOMMAND=python -m pytest  -n4 --dropfirst {[testenv]cov_args}
5849dfeda6SMike Bayer    cov: USEDEVELOP=True
59f30e35baSMike Bayer
607f423e87SMike Bayer# tox as of 2.0 blocks all environment variables from the
617f423e87SMike Bayer# outside, unless they are here (or in TOX_TESTENV_PASSENV,
62077f26afSMike Bayer# wildcards OK).  Need at least these
63077f26afSMike Bayerpassenv=ORACLE_HOME NLS_LANG
647f423e87SMike Bayer
6549dfeda6SMike Bayer# for nocext, we rm *.so in lib in case we are doing usedevelop=True
669281e700SMike Bayercommands=
6749dfeda6SMike Bayer  nocext: sh -c "rm -f lib/sqlalchemy/*.so"
68d100bfcfSMike Bayer  default: {env:BASECOMMAND} {posargs}
69d100bfcfSMike Bayer  sqlitepg: {env:BASECOMMAND} --db sqlite --db postgresql {posargs}
70d100bfcfSMike Bayer  mysql: {env:BASECOMMAND} --db mysql --db pymysql {posargs}
71d100bfcfSMike Bayer  oracle: {env:BASECOMMAND} --db oracle {posargs}
72d100bfcfSMike Bayer  mssql: {env:BASECOMMAND} --db pyodbc --db pymssql {posargs}
73d100bfcfSMike Bayer  cov: {env:BASECOMMAND} --db sqlite --db postgresql --db mysql {posargs}
749281e700SMike Bayer
759281e700SMike Bayer[testenv:pep8]
761217d6ceSMike Bayerdeps=flake8
7730ab1a02SMike Bayercommands = python -m flake8 {posargs}
789281e700SMike Bayer
799281e700SMike Bayer[flake8]
809281e700SMike Bayershow-source = True
812743b674SMike Bayerignore = E711,E712,E721,N806
829281e700SMike Bayerexclude=.venv,.git,.tox,dist,doc,*egg,build
839281e700SMike Bayer
84