Skip to content

Commit

Permalink
Don't use python2
Browse files Browse the repository at this point in the history
  • Loading branch information
rshkv committed Apr 11, 2020
1 parent 70078a4 commit da352c9
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dev/build-apache-spark.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python

#
# Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down
10 changes: 5 additions & 5 deletions dev/lint-python
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function compile_python_test {

# compileall: https://docs.python.org/2/library/compileall.html
echo "starting python compilation test..."
COMPILE_REPORT=$( (python2 -B -mcompileall -q -l $1) 2>&1)
COMPILE_REPORT=$( (python -B -mcompileall -q -l $1) 2>&1)
COMPILE_STATUS=$?

if [ $COMPILE_STATUS -ne 0 ]; then
Expand Down Expand Up @@ -70,7 +70,7 @@ function pycodestyle_test {
RUN_LOCAL_PYCODESTYLE="False"
if hash "$PYCODESTYLE_BUILD" 2> /dev/null; then
VERSION=$( $PYCODESTYLE_BUILD --version 2> /dev/null)
EXPECTED_PYCODESTYLE=$( (python2 -c 'from distutils.version import LooseVersion;
EXPECTED_PYCODESTYLE=$( (python -c 'from distutils.version import LooseVersion;
print(LooseVersion("""'${VERSION[0]}'""") >= LooseVersion("""'$MINIMUM_PYCODESTYLE'"""))')\
2> /dev/null)

Expand All @@ -96,7 +96,7 @@ function pycodestyle_test {
fi

echo "starting pycodestyle test..."
PYCODESTYLE_REPORT=$( (python2 "$PYCODESTYLE_SCRIPT_PATH" --config=dev/tox.ini $1) 2>&1)
PYCODESTYLE_REPORT=$( (python "$PYCODESTYLE_SCRIPT_PATH" --config=dev/tox.ini $1) 2>&1)
PYCODESTYLE_STATUS=$?
else
# we have the right version installed, so run locally
Expand Down Expand Up @@ -130,7 +130,7 @@ function flake8_test {

FLAKE8_VERSION="$($FLAKE8_BUILD --version 2> /dev/null)"
VERSION=($FLAKE8_VERSION)
EXPECTED_FLAKE8=$( (python2 -c 'from distutils.version import LooseVersion;
EXPECTED_FLAKE8=$( (python -c 'from distutils.version import LooseVersion;
print(LooseVersion("""'${VERSION[0]}'""") >= LooseVersion("""'$MINIMUM_FLAKE8'"""))') \
2> /dev/null)

Expand Down Expand Up @@ -175,7 +175,7 @@ function pydocstyle_test {
fi

PYDOCSTYLE_VERSION="$($PYDOCSTYLEBUILD --version 2> /dev/null)"
EXPECTED_PYDOCSTYLE=$(python2 -c 'from distutils.version import LooseVersion; \
EXPECTED_PYDOCSTYLE=$(python -c 'from distutils.version import LooseVersion; \
print(LooseVersion("""'$PYDOCSTYLE_VERSION'""") >= LooseVersion("""'$MINIMUM_PYDOCSTYLE'"""))' \
2> /dev/null)

Expand Down
2 changes: 1 addition & 1 deletion dev/run-backcompat-tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python

#
# Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down
2 changes: 1 addition & 1 deletion dev/run-build-tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python

#
# Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down
2 changes: 1 addition & 1 deletion dev/run-python-tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python

#
# Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down
2 changes: 1 addition & 1 deletion dev/run-r-tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python

#
# Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down
2 changes: 1 addition & 1 deletion dev/run-scala-tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python

#
# Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down
2 changes: 1 addition & 1 deletion dev/run-style-tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python

#
# Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down
2 changes: 1 addition & 1 deletion dev/run-tests-jenkins.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python

#
# Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down
2 changes: 1 addition & 1 deletion dev/sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python

#
# Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down
2 changes: 1 addition & 1 deletion dev/test-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if [ $? != 0 ]; then
exit 1
fi
set -e
TEMP_VERSION="spark-$(python2 -S -c "import random; print(random.randrange(100000, 999999))")"
TEMP_VERSION="spark-$(python -S -c "import random; print(random.randrange(100000, 999999))")"

function reset_version {
# Delete the temporary POMs that we wrote to the local Maven repo:
Expand Down
2 changes: 1 addition & 1 deletion dev/test_functions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python

#
# Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down
2 changes: 1 addition & 1 deletion python/run-tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python

#
# Licensed to the Apache Software Foundation (ASF) under one or more
Expand Down

0 comments on commit da352c9

Please sign in to comment.