You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by al...@apache.org on 2019/02/12 23:12:44 UTC

[beam] branch master updated: Add py3 cython tox environment

This is an automated email from the ASF dual-hosted git repository.

altay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new f55441a  Add py3 cython tox environment
     new 04c5e74  Merge pull request #7802 from RobbeSneyders/py3-cython
f55441a is described below

commit f55441a8279ce318a4f95d13038bd5bf8a0ff034
Author: robbe <ro...@ml6.eu>
AuthorDate: Mon Feb 11 10:56:28 2019 +0100

    Add py3 cython tox environment
---
 sdks/python/build.gradle | 18 +++++++++++++-----
 sdks/python/tox.ini      | 18 +++++++++++++++++-
 2 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/sdks/python/build.gradle b/sdks/python/build.gradle
index e5d301d..024a228 100644
--- a/sdks/python/build.gradle
+++ b/sdks/python/build.gradle
@@ -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
@@ -105,7 +112,8 @@ toxTask "cover", "cover"
 
 task preCommit() {
   dependsOn "docs"
-  dependsOn "testCython"
+  dependsOn "testPy2Cython"
+  dependsOn "testPy3Cython"
   dependsOn "testPython2"
   dependsOn "testPython3"
   dependsOn "testPy2Gcp"
diff --git a/sdks/python/tox.ini b/sdks/python/tox.ini
index 743e0bd..9fe5412 100644
--- a/sdks/python/tox.ini
+++ b/sdks/python/tox.ini
@@ -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]
@@ -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 =