From dffb5ddc465b9e0b1220b5713c17ff4aaf9b7dbc Mon Sep 17 00:00:00 2001 From: Nicholas Chammas Date: Sun, 3 Aug 2014 14:11:57 -0400 Subject: [PATCH] [SPARK-2627] download pep8 at runtime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See the discussion here: https://github.com/apache/spark/pull/1744#issuecomment-50982162 Get the pep8 utility at runtime so that it’s not required to be installed on the build server. --- dev/lint-python | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dev/lint-python b/dev/lint-python index 50e52460be1e7..2d67084dd9587 100755 --- a/dev/lint-python +++ b/dev/lint-python @@ -22,11 +22,21 @@ SPARK_ROOT_DIR="$(dirname $SCRIPT_DIR)" PEP8_REPORT_PATH="$SPARK_ROOT_DIR/dev/pep8-report.txt" cd $SPARK_ROOT_DIR + +# See: https://github.com/apache/spark/pull/1744#issuecomment-50982162 +# Get pep8 at runtime so that we don't rely on it being installed on the build server. +# TODOs: +# - Dynamically determine latest release version of pep8 and use that. +# - Download this from a more reliable source. (GitHub raw can be flaky, apparently. (?)) +PEP8_SCRIPT_PATH="$SPARK_ROOT_DIR/dev/pep8.py" +curl --silent -o "$PEP8_SCRIPT_PATH" \ + "https://raw.githubusercontent.com/jcrocholl/pep8/1.5.7/pep8.py" + # There is no need to write this output to a file #+ first, but we do so so that the check status can #+ be output before the report, like with the #+ scalastyle and RAT checks. -pep8 ./python --exclude="cloudpickle.py" \ +python $PEP8_SCRIPT_PATH ./python --exclude="cloudpickle.py" \ > "$PEP8_REPORT_PATH" pep8_status=${PIPESTATUS[0]} #$? @@ -39,4 +49,6 @@ if [ $pep8_status -ne 0 ] fi rm -f "$PEP8_REPORT_PATH" +rm "$PEP8_SCRIPT_PATH" + exit $pep8_status