Skip to content

Commit

Permalink
Add py3 cython tox environment
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbeSneyders committed Feb 12, 2019
1 parent 98d7f0d commit f55441a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
18 changes: 13 additions & 5 deletions sdks/python/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,19 @@ test.dependsOn testPython2
toxTask "testPython3", "py3"
test.dependsOn testPython3

toxTask "testCython", "py27-cython"
test.dependsOn testCython
// Ensure that testCython runs exclusively to other tests. This line is not
toxTask "testPy2Cython", "py27-cython"
test.dependsOn testPy2Cython
// Ensure that testPy2Cython runs exclusively to other tests. This line is not
// actually required, since gradle doesn't do parallel execution within a
// project.
testCython.mustRunAfter testPython2, testPy2Gcp
testPy2Cython.mustRunAfter testPython2, testPy2Gcp

toxTask "testPy3Cython", "py3-cython"
test.dependsOn testPy3Cython
// Ensure that testPy3Cython runs exclusively to other tests. This line is not
// actually required, since gradle doesn't do parallel execution within a
// project.
testPy3Cython.mustRunAfter testPython3, testPy3Gcp

toxTask "docs", "docs"
assemble.dependsOn docs
Expand All @@ -105,7 +112,8 @@ toxTask "cover", "cover"

task preCommit() {
dependsOn "docs"
dependsOn "testCython"
dependsOn "testPy2Cython"
dependsOn "testPy3Cython"
dependsOn "testPython2"
dependsOn "testPython3"
dependsOn "testPy2Gcp"
Expand Down
18 changes: 17 additions & 1 deletion sdks/python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

[tox]
# new environments will be excluded by default unless explicitly added to envlist.
envlist = py27,py3,py27-{gcp,cython,lint,lint3},py3-{gcp,lint},docs
envlist = py27,py3,py27-{gcp,cython,lint,lint3},py3-{gcp,cython,lint},docs
toxworkdir = {toxinidir}/target/.tox

[pycodestyle]
Expand Down Expand Up @@ -78,6 +78,22 @@ commands =
python setup.py nosetests
{toxinidir}/scripts/run_tox_cleanup.sh

[testenv:py3-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 = linux
setenv =
RUN_SKIPPED_PY3_TESTS=0
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 =
Expand Down

0 comments on commit f55441a

Please sign in to comment.