[
https://issues.apache.org/jira/browse/BEAM-4113?focusedWorklogId=94912&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-94912
]
ASF GitHub Bot logged work on BEAM-4113:
----------------------------------------
Author: ASF GitHub Bot
Created on: 25/Apr/18 01:53
Start Date: 25/Apr/18 01:53
Worklog Time Spent: 10m
Work Description: udim closed pull request #5162: [BEAM-4113] Install
latest pip/virtualenv in Gradle Python precommit.
URL: https://github.com/apache/beam/pull/5162
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 5984b35f791..7cb82062d7d 100644
--- a/sdks/python/build.gradle
+++ b/sdks/python/build.gradle
@@ -30,9 +30,38 @@ def tox_opts = "-c tox.ini --recreate"
task setupVirtualenv {
doLast {
- exec {
- commandLine 'virtualenv', "${envdir}"
+ if (System.getenv('JENKINS_URL') != null) {
+ // Upgrade pip and install virtualenv on a Jenkins machine.
+ exec {
+ executable 'sh'
+ args '-c', 'python -m pip install --user --upgrade pip'
+ }
+ exec {
+ executable 'sh'
+ args '-c', 'python -m pip install --user --upgrade virtualenv'
+ }
+ // Create virtual environment on a Jenkins machine.
+ exec {
+ executable 'sh'
+ args '-c', 'python --version; python -m pip --version; echo -n
"virtualenv "; python -m virtualenv --version'
+ }
+ exec {
+ executable 'sh'
+ args '-c', "python -m virtualenv ${envdir}"
+ }
+ } else {
+ // Create virtual environment on a development machine. Development
+ // machines should have correct pip and virtualenv versions installed.
+ exec {
+ executable 'sh'
+ args '-c', 'python --version; pip --version; echo -n "virtualenv ";
virtualenv --version'
+ }
+ exec {
+ executable 'sh'
+ args '-c', "virtualenv ${envdir}"
+ }
}
+
exec {
executable 'sh'
args '-c', ". ${envdir}/bin/activate && pip install --upgrade tox==3.0.0
grpcio-tools==1.3.5"
----------------------------------------------------------------
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: 94912)
Time Spent: 40m (was: 0.5h)
> Periodic cleanup and setup of Python environment on Jenkins machines
> --------------------------------------------------------------------
>
> Key: BEAM-4113
> URL: https://issues.apache.org/jira/browse/BEAM-4113
> Project: Beam
> Issue Type: Improvement
> Components: testing
> Reporter: Udi Meiri
> Assignee: Jason Kuster
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Instead of having Python testing scripts tidy up the environment every time
> they run, let's have a single script that runs once per day and does:
> # Check if pip is installed under ~/.local and is the expected version. If
> not, install the correct version.
> # Same as above, but for virtualenv.
> # Print a list of packages installed under ~/.local.
> # Optional: Uninstall any unexpected packages under ~/.local. For example,
> apache-beam shouldn't be installed under ~/.local, since 2 concurrent tests
> on the same machine will attempt to install to the same location.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)