[
https://issues.apache.org/jira/browse/BEAM-3253?focusedWorklogId=164978&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-164978
]
ASF GitHub Bot logged work on BEAM-3253:
----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Nov/18 14:50
Start Date: 12/Nov/18 14:50
Worklog Time Spent: 10m
Work Description: robertwb closed pull request #6692: [BEAM-3253] Specify
gradle dependencies for Python tox tasks.
URL: https://github.com/apache/beam/pull/6692
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/sdks/python/build.gradle b/sdks/python/build.gradle
index c1e3122f229..4b8b6f94480 100644
--- a/sdks/python/build.gradle
+++ b/sdks/python/build.gradle
@@ -92,101 +92,65 @@ build.dependsOn buildPython
/*************************************************************************************************/
// Unit testing
-task lint {}
-check.dependsOn lint
-
-task lintPy27(dependsOn: 'setupVirtualenv') {
- doLast {
- exec {
- executable 'sh'
- args '-c', ". ${envdir}/bin/activate && ./scripts/run_tox.sh py27-lint"
+def pythonSdkDeps = files(
+ fileTree(dir: 'apache_beam', includes: ['**/*.py', '**/*.pyx',
'**/*.pxd']),
+ fileTree(dir: 'apache_beam/testing/data'),
+ fileTree(dir: "${project.rootDir}/model"),
+ fileTree(dir: 'scripts'),
+ ".pylintrc",
+ "MANIFEST.in",
+ "gen_protos.py",
+ "setup.cfg",
+ "setup.py",
+ "test_config.py",
+ "tox.ini")
+
+def toxTask = {
+ name, tox_env -> tasks.create(name) {
+ dependsOn = ['setupVirtualenv']
+ doLast {
+ exec {
+ executable 'sh'
+ args '-c', ". ${envdir}/bin/activate && ./scripts/run_tox.sh $tox_env"
+ }
}
+ inputs.files pythonSdkDeps
+ outputs.files fileTree(dir:
"${project.rootDir}/sdks/python/target/.tox/${tox_env}/log/")
}
}
+
+task lint {}
+check.dependsOn lint
+
+toxTask "lintPy27", "py27-lint"
lint.dependsOn lintPy27
-task lintPy27_3(dependsOn: 'setupVirtualenv') {
- doLast {
- exec {
- executable 'sh'
- args '-c', ". ${envdir}/bin/activate && ./scripts/run_tox.sh py27-lint3"
- }
- }
-}
+toxTask "lintPy27_3", "py27-lint3"
lint.dependsOn lintPy27_3
-task lintPy3(dependsOn: 'setupVirtualenv') {
- doLast {
- exec {
- executable 'sh'
- args '-c', ". ${envdir}/bin/activate && ./scripts/run_tox.sh py3-lint"
- }
- }
-}
+toxTask "lintPy3", "py3-lint"
lint.dependsOn lintPy3
-task testGcp(dependsOn: 'setupVirtualenv') {
- doLast {
- exec {
- executable 'sh'
- args '-c', ". ${envdir}/bin/activate && ./scripts/run_tox.sh py27-gcp"
- }
- }
-}
+toxTask "testGcp", "py27-gcp"
test.dependsOn testGcp
-task testPython2(dependsOn: 'setupVirtualenv') {
- doLast {
- exec {
- executable 'sh'
- args '-c', ". ${envdir}/bin/activate && ./scripts/run_tox.sh py27"
- }
- }
-}
+toxTask "testPython2", "py27"
test.dependsOn testPython2
-task testPython3(dependsOn: 'setupVirtualenv') {
- doLast {
- exec {
- executable 'sh'
- args '-c', ". ${envdir}/bin/activate && ./scripts/run_tox.sh py3"
- }
- }
-}
+toxTask "testPython3", "py3"
test.dependsOn testPython3
-task testCython(dependsOn: 'setupVirtualenv') {
- doLast {
- exec {
- executable 'sh'
- args '-c', ". ${envdir}/bin/activate && ./scripts/run_tox.sh py27-cython"
- }
- }
-}
+toxTask "testCython", "py27-cython"
test.dependsOn testCython
// Ensure that testCython runs exclusively to other tests. This line is not
// actually required, since gradle doesn't do parallel execution within a
// project.
testCython.mustRunAfter testPython2, testGcp
-task docs(dependsOn: 'setupVirtualenv') {
- doLast {
- exec {
- executable 'sh'
- args '-c', ". ${envdir}/bin/activate && ./scripts/run_tox.sh docs"
- }
- }
-}
+toxTask "docs", "docs"
assemble.dependsOn docs
-task cover(dependsOn: 'setupVirtualenv') {
- doLast {
- exec {
- executable 'sh'
- args '-c', ". ${envdir}/bin/activate && ./scripts/run_tox.sh cover"
- }
- }
-}
+toxTask "cover", "cover"
task preCommit() {
dependsOn "docs"
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 164978)
Time Spent: 6h (was: 5h 50m)
> Gradle configurations do not declare correct inputs/outputs, requiring
> --rerun-tasks
> ------------------------------------------------------------------------------------
>
> Key: BEAM-3253
> URL: https://issues.apache.org/jira/browse/BEAM-3253
> Project: Beam
> Issue Type: Sub-task
> Components: build-system
> Reporter: Luke Cwik
> Priority: Major
> Time Spent: 6h
> Remaining Estimate: 0h
>
> Support incremental builds by ensuring all tasks correctly specify their
> inputs and outputs.
> This is currently not correctly setup for any shell tasks and all code
> generation tasks.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)