|
| 1 | +; Tox is a testing tool that manages virtualenvs for testing multiple Python |
| 2 | +; environments in a consistent/controlled way. |
| 3 | + |
| 4 | +; SETTING ENVIRONMENT VARIABLES AND TOX TESTING VARIABLES |
| 5 | +; |
| 6 | +; You can limit tox testing to certain environments via the `-e` (envlist) |
| 7 | +; command line option: |
| 8 | +; tox -e py27-core,py34-core |
| 9 | +; OR, you can just set the `TOXENV` environment variable, which is handy: |
| 10 | +; TOXENV=py27-core,py34-core |
| 11 | +; |
| 12 | +; Integrating with the virtualenvs in Circle CI is a bit of a pain. For |
| 13 | +; whatever reason the "executable" `python35` (at the time of writing) cannot |
| 14 | +; be activated directly. Instead the circle.yml file specifies the actual |
| 15 | +; binary directly. Because of this, you too have to set the following env |
| 16 | +; variables: |
| 17 | +; PLOTLY_TOX_PYTHON_27=python2.7 |
| 18 | +; PLOTLY_TOX_PYTHON_34=python3.4 |
| 19 | +; ... |
| 20 | +; These will be specific to your machine and may not look like the ones above. |
| 21 | +; If you're not testing with all the python versions (see TOXENV above), |
| 22 | +; there's no need to install and map other versions. |
| 23 | + |
| 24 | +; PASSING ADDITONAL ARGUMENTS TO TEST COMMANDS |
| 25 | +; The {posargs} is tox-specific and passes in any command line args after `--`. |
| 26 | +; For example, given the testing command in *this* file: |
| 27 | +; nosetests {posargs} -x plotly/tests/test_core |
| 28 | +; |
| 29 | +; The following command: |
| 30 | +; tox -- -a '!slow' |
| 31 | +; |
| 32 | +; Tells tox to call: |
| 33 | +; nosetests -a '!slow' -x plotly/tests/test_core |
| 34 | +; |
| 35 | +; Which is a nice way to skip slow tests for faster testing cycles. |
| 36 | + |
| 37 | +[tox] |
| 38 | +; The py{A,B,C}-{X,Y} generates a matrix of envs: |
| 39 | +; pyA-X,pyA-Y,pyB-X,pyB-Y,pyC-X,pyC-Y |
| 40 | +envlist = py{27,34,35}-{core,optional} |
| 41 | + |
| 42 | +; Note that envs can be targeted by deps using the <target>: dep syntax. |
| 43 | +; Only one dep is allowed per line as of the time of writing. The <target> |
| 44 | +; can be a `-` (hyphen) concatenated string of the environments to target |
| 45 | +; with the given dep. |
| 46 | + |
| 47 | +; These commands are general and will be run for *all* environments. |
| 48 | +[testenv] |
| 49 | +deps= |
| 50 | + mock==2.0.0 |
| 51 | + nose==1.3.7 |
| 52 | + requests==2.12.4 |
| 53 | + six==1.10.0 |
| 54 | + pytz==2016.10 |
| 55 | + optional: numpy==1.11.3 |
| 56 | + optional: ipython[all]==5.1.0 |
| 57 | + optional: pandas==0.19.2 |
| 58 | + optional: scipy==0.18.1 |
| 59 | +commands= |
| 60 | +; Sanity check that we're testing what we *think* we're testing. |
| 61 | + python --version |
| 62 | +; core: nosetests {posargs} -x plotly/tests/test_core |
| 63 | +; optional: nosetests {posargs} -x -a '!matplotlib' plotly/tests |
| 64 | + |
| 65 | +; CORE ENVIRONMENTS |
| 66 | +[testenv:py27-core] |
| 67 | +basepython={env:PLOTLY_TOX_PYTHON_27:} |
| 68 | + |
| 69 | +[testenv:py34-core] |
| 70 | +basepython={env:PLOTLY_TOX_PYTHON_34:} |
| 71 | + |
| 72 | +[testenv:py35-core] |
| 73 | +basepython={env:PLOTLY_TOX_PYTHON_35:} |
| 74 | + |
| 75 | +; OPTIONAL ENVIRONMENTS |
| 76 | +[testenv:py27-optional] |
| 77 | +basepython={env:PLOTLY_TOX_PYTHON_27:} |
| 78 | + |
| 79 | +[testenv:py34-optional] |
| 80 | +basepython={env:PLOTLY_TOX_PYTHON_34:} |
| 81 | + |
| 82 | +[testenv:py35-optional] |
| 83 | +basepython={env:PLOTLY_TOX_PYTHON_35:} |
0 commit comments