Skip to content

Commit

Permalink
[SPARK-2627] download pep8 at runtime
Browse files Browse the repository at this point in the history
See the discussion here:
#1744 (comment)

Get the pep8 utility at runtime so that it’s not required to be
installed on the build server.
  • Loading branch information
nchammas committed Aug 3, 2014
1 parent a1ce7ae commit dffb5dd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion dev/lint-python
Original file line number Diff line number Diff line change
Expand Up @@ -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]} #$?

Expand All @@ -39,4 +49,6 @@ if [ $pep8_status -ne 0 ]
fi

rm -f "$PEP8_REPORT_PATH"
rm "$PEP8_SCRIPT_PATH"

exit $pep8_status

0 comments on commit dffb5dd

Please sign in to comment.