| ; |
| ; Licensed to the Apache Software Foundation (ASF) under one or more |
| ; contributor license agreements. See the NOTICE file distributed with |
| ; this work for additional information regarding copyright ownership. |
| ; The ASF licenses this file to You under the Apache License, Version 2.0 |
| ; (the "License"); you may not use this file except in compliance with |
| ; the License. You may obtain a copy of the License at |
| ; |
| ; http://www.apache.org/licenses/LICENSE-2.0 |
| ; |
| ; Unless required by applicable law or agreed to in writing, software |
| ; distributed under the License is distributed on an "AS IS" BASIS, |
| ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| ; See the License for the specific language governing permissions and |
| ; limitations under the License. |
| ; |
| |
| [tox] |
| # new environments will be excluded by default unless explicitly added to envlist. |
| envlist = py27,py3,py27-{gcp,cython,lint,lint3},py3-lint,docs |
| toxworkdir = {toxinidir}/target/.tox |
| |
| [pycodestyle] |
| # Disable all errors and warnings except for the ones related to blank lines. |
| # pylint does not check the number of blank lines. |
| select = E3 |
| |
| # Shared environment options. |
| [testenv] |
| # Set [] options for pip installation of apache-beam tarball. |
| extras = test |
| # Don't warn that these commands aren't installed. |
| whitelist_externals = |
| find |
| time |
| deps = |
| cython: cython==0.28.1 |
| future==0.16.0 |
| |
| # These 2 magic command overrides are required for Jenkins builds. |
| # Otherwise we get "OSError: [Errno 2] No such file or directory" errors. |
| # Source: |
| # https://github.com/tox-dev/tox/issues/123#issuecomment-284714629 |
| install_command = {envbindir}/python {envbindir}/pip install {opts} {packages} |
| list_dependencies_command = {envbindir}/python {envbindir}/pip freeze |
| |
| [testenv:py27] |
| commands = |
| python --version |
| pip --version |
| {toxinidir}/scripts/run_tox_cleanup.sh |
| python apache_beam/examples/complete/autocomplete_test.py |
| python setup.py nosetests |
| {toxinidir}/scripts/run_tox_cleanup.sh |
| |
| [testenv:py3] |
| setenv = |
| BEAM_EXPERIMENTAL_PY3=1 |
| modules = |
| apache_beam.typehints,apache_beam.coders,apache_beam.options,apache_beam.tools,apache_beam.utils,apache_beam.internal,apache_beam.metrics,apache_beam.portability,apache_beam.pipeline_test,apache_beam.pvalue_test,apache_beam.runners |
| commands = |
| python --version |
| pip --version |
| {toxinidir}/scripts/run_tox_cleanup.sh |
| python setup.py nosetests --tests {[testenv:py3]modules} |
| {toxinidir}/scripts/run_tox_cleanup.sh |
| |
| [testenv:py27-cython] |
| # cython tests are only expected to work in linux (2.x and 3.x) |
| # If we want to add other platforms in the future, it should be: |
| # `platform = linux2|darwin|...` |
| # See https://docs.python.org/2/library/sys.html#sys.platform for platform codes |
| platform = linux2 |
| commands = |
| python --version |
| pip --version |
| {toxinidir}/scripts/run_tox_cleanup.sh |
| python apache_beam/examples/complete/autocomplete_test.py |
| python setup.py nosetests |
| {toxinidir}/scripts/run_tox_cleanup.sh |
| |
| [testenv:py27-gcp] |
| extras = test,gcp |
| commands = |
| python --version |
| pip --version |
| {toxinidir}/scripts/run_tox_cleanup.sh |
| python apache_beam/examples/complete/autocomplete_test.py |
| python setup.py nosetests |
| {toxinidir}/scripts/run_tox_cleanup.sh |
| |
| [testenv:py27-lint] |
| deps = |
| pycodestyle==2.3.1 |
| pylint==1.9.3 |
| future==0.16.0 |
| isort==4.2.15 |
| flake8==3.5.0 |
| commands = |
| pylint --version |
| pip --version |
| {toxinidir}/scripts/run_tox_cleanup.sh |
| time {toxinidir}/scripts/run_pylint.sh |
| |
| [testenv:py27-lint3] |
| # Checks for py2/3 compatibility issues |
| deps = |
| pycodestyle==2.3.1 |
| pylint==1.9.3 |
| future==0.16.0 |
| isort==4.2.15 |
| flake8==3.5.0 |
| commands = |
| pylint --version |
| pip --version |
| {toxinidir}/scripts/run_tox_cleanup.sh |
| time {toxinidir}/scripts/run_pylint_2to3.sh |
| |
| |
| [testenv:py3-lint] |
| deps = |
| pycodestyle==2.3.1 |
| pylint==2.1.1 |
| future==0.16.0 |
| isort==4.2.15 |
| flake8==3.5.0 |
| setenv = |
| BEAM_EXPERIMENTAL_PY3=1 |
| commands = |
| pylint --version |
| pip --version |
| {toxinidir}/scripts/run_tox_cleanup.sh |
| time {toxinidir}/scripts/run_mini_py3lint.sh |
| |
| [testenv:docs] |
| extras = test,gcp,docs |
| deps = |
| Sphinx==1.6.5 |
| sphinx_rtd_theme==0.2.4 |
| commands = |
| python --version |
| pip --version |
| time {toxinidir}/scripts/generate_pydoc.sh |
| |
| [testenv:cover] |
| # This is not included in envlist which is defined in [tox]. |
| deps = |
| coverage==4.4.1 |
| commands = |
| python --version |
| pip --version |
| {toxinidir}/scripts/run_tox_cleanup.sh |
| # Clean up previously collected data. |
| coverage erase |
| coverage run setup.py test |
| # Print coverage report to STDOUT |
| coverage report --skip-covered |
| # Generate report in xml format |
| coverage xml |