Skip to content

Apache DataFusion SQL Query Engine

ARROW-7895: [Python] Remove more python 2.7 cruft

Neal Richardson0ee542365271
diff --git a/dev/release/download_rc_binaries.py b/dev/release/download_rc_binaries.py
index da66e483d3..843f0c07eb 100755
--- a/dev/release/download_rc_binaries.py
+++ b/dev/release/download_rc_binaries.py
@@ -18,21 +18,15 @@
#
import re
-import sys
-
-try:
- import argparse
- import concurrent.futures as cf
- import functools
- import hashlib
- import json
- import os
- import subprocess
- import urllib.request
-except ImportError:
- if sys.version_info.major < 3:
- raise Exception("Please use Python 3 to run this script")
- raise
+
+import argparse
+import concurrent.futures as cf
+import functools
+import hashlib
+import json
+import os
+import subprocess
+import urllib.request
BINTRAY_API_ROOT = "https://bintray.com/api/v1"
diff --git a/dev/release/verify-release-candidate.sh b/dev/release/verify-release-candidate.sh
index ac5ceca7f6..653967adc8 100755
--- a/dev/release/verify-release-candidate.sh
+++ b/dev/release/verify-release-candidate.sh
@@ -614,7 +614,7 @@ check_python_imports() {
}
test_linux_wheels() {
- local py_arches="2.7mu 3.5m 3.6m 3.7m 3.8"
+ local py_arches="3.5m 3.6m 3.7m 3.8"
local manylinuxes="1 2010 2014"
for py_arch in ${py_arches}; do
@@ -623,11 +623,6 @@ test_linux_wheels() {
conda activate ${env}
for ml_spec in ${manylinuxes}; do
- if [[ "$py_arch" = "2.7mu" && "$ml_spec" = "2014" ]]; then
- # manylinux2014 does not support py2.7, so skip that one
- continue
- fi
-
# check the mandatory and optional imports
pip install python-rc/${VERSION}-rc${RC_NUMBER}/pyarrow-${VERSION}-cp${py_arch//[mu.]/}-cp${py_arch//./}-manylinux${ml_spec}_x86_64.whl
check_python_imports py_arch
@@ -644,7 +639,7 @@ test_linux_wheels() {
}
test_macos_wheels() {
- local py_arches="2.7m 3.5m 3.6m 3.7m 3.8"
+ local py_arches="3.5m 3.6m 3.7m 3.8"
for py_arch in ${py_arches}; do
local env=_verify_wheel-${py_arch}
diff --git a/dev/tasks/gandiva-jars/build-cpp-linux.sh b/dev/tasks/gandiva-jars/build-cpp-linux.sh
index 3fefa45c57..61c82495af 100755
--- a/dev/tasks/gandiva-jars/build-cpp-linux.sh
+++ b/dev/tasks/gandiva-jars/build-cpp-linux.sh
@@ -22,8 +22,8 @@ source /multibuild/manylinux_utils.sh
# Quit on failure
set -e
-PYTHON_VERSION=2.7
-CPYTHON_PATH="$(cpython_path ${PYTHON_VERSION} 16)"
+PYTHON_VERSION=3.6
+CPYTHON_PATH="$(cpython_path ${PYTHON_VERSION})"
PYTHON_INTERPRETER="${CPYTHON_PATH}/bin/python"
PIP="${CPYTHON_PATH}/bin/pip"
@@ -69,4 +69,3 @@ popd
# copy the library to distribution
cp -L /arrow-dist/lib/libgandiva_jni.so /io/dist
-
diff --git a/dev/tasks/python-wheels/manylinux-test.sh b/dev/tasks/python-wheels/manylinux-test.sh
index 414279115f..c4b36e658a 100755
--- a/dev/tasks/python-wheels/manylinux-test.sh
+++ b/dev/tasks/python-wheels/manylinux-test.sh
@@ -37,15 +37,12 @@ fi
# Test import and optional dependencies
python -c "
-import sys
import pyarrow
import pyarrow.parquet
import pyarrow.plasma
import pyarrow.fs
import pyarrow._hdfs
-
-if sys.version_info.major > 2:
- import pyarrow.dataset
- import pyarrow.flight
- import pyarrow.gandiva
+import pyarrow.dataset
+import pyarrow.flight
+import pyarrow.gandiva
"
diff --git a/dev/tasks/python-wheels/osx-build.sh b/dev/tasks/python-wheels/osx-build.sh
index 581ac0b530..30c411bc97 100755
--- a/dev/tasks/python-wheels/osx-build.sh
+++ b/dev/tasks/python-wheels/osx-build.sh
@@ -104,14 +104,8 @@ function build_wheel {
pip install $(pip_opts) -r python/requirements-wheel.txt cython
- if [ ${MB_PYTHON_VERSION} != "2.7" ]; then
- # Gandiva is not supported on Python 2.7
- export PYARROW_WITH_GANDIVA=1
- export BUILD_ARROW_GANDIVA=ON
- else
- export PYARROW_WITH_GANDIVA=0
- export BUILD_ARROW_GANDIVA=OFF
- fi
+ export PYARROW_WITH_GANDIVA=1
+ export BUILD_ARROW_GANDIVA=ON
git submodule update --init
export ARROW_TEST_DATA=`pwd`/testing/data
@@ -217,16 +211,13 @@ function run_unit_tests {
function run_import_tests {
# Test optional dependencies
python -c "
-import sys
import pyarrow
import pyarrow.parquet
import pyarrow.plasma
import pyarrow.fs
import pyarrow._hdfs
-
-if sys.version_info.major > 2:
- import pyarrow.dataset
- import pyarrow.flight
- import pyarrow.gandiva
+import pyarrow.dataset
+import pyarrow.flight
+import pyarrow.gandiva
"
}
diff --git a/dev/tasks/python-wheels/win-build.bat b/dev/tasks/python-wheels/win-build.bat
index b93cd8893a..8247a5a3aa 100644
--- a/dev/tasks/python-wheels/win-build.bat
+++ b/dev/tasks/python-wheels/win-build.bat
@@ -72,8 +72,6 @@ popd
set PYARROW_BUILD_TYPE=Release
set PYARROW_PARALLEL=8
-@rem Flight, Gandiva and Dataset are not supported on Python 2.7,
-@rem but we don't build 2.7 wheels for Windows.
set PYARROW_WITH_DATASET=1
set PYARROW_WITH_FLIGHT=1
set PYARROW_WITH_GANDIVA=1
diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml
index 023c867fdb..6e64293f0c 100644
--- a/dev/tasks/tasks.yml
+++ b/dev/tasks/tasks.yml
@@ -97,7 +97,6 @@ groups:
- test-ubuntu-c-glib
- test-debian-ruby
- test-ubuntu-ruby
- - test-conda-python-2.7
- test-conda-python-3.6
- test-conda-python-3.7
- test-conda-python-3.8
@@ -115,8 +114,6 @@ groups:
- test-ubuntu-18.04-r-sanitizer
- test-debian-10-go-1.12
- test-ubuntu-18.04-docs
- - test-conda-python-2.7-pandas-latest
- - test-conda-python-2.7-pandas-master
- test-conda-python-3.7-pandas-latest
- test-conda-python-3.7-pandas-master
- test-conda-python-3.8-pandas-latest
@@ -141,7 +138,6 @@ groups:
- test-ubuntu-c-glib
- test-debian-ruby
- test-ubuntu-ruby
- - test-conda-python-2.7
- test-conda-python-3.6
- test-conda-python-3.7
- test-conda-python-3.8
@@ -175,7 +171,6 @@ groups:
- test-ubuntu-c-glib
python:
- - test-conda-python-2.7
- test-conda-python-3.6
- test-conda-python-3.7
- test-conda-python-3.8
@@ -199,8 +194,6 @@ groups:
- test-ubuntu-ruby
integration:
- - test-conda-python-2.7-pandas-latest
- - test-conda-python-2.7-pandas-master
- test-conda-python-3.7-pandas-latest
- test-conda-python-3.7-pandas-master
- test-conda-python-3.8-pandas-latest
@@ -269,7 +262,6 @@ groups:
- test-ubuntu-c-glib
- test-debian-ruby
- test-ubuntu-ruby
- - test-conda-python-2.7
- test-conda-python-3.6
- test-conda-python-3.7
- test-debian-10-python-3
@@ -285,7 +277,6 @@ groups:
- test-ubuntu-18.04-r-sanitizer
- test-debian-10-go-1.12
- test-ubuntu-18.04-docs
- - test-conda-python-2.7-pandas-latest
- test-conda-python-3.7-pandas-latest
- test-conda-python-3.7-pandas-master
- test-conda-python-3.8-pandas-latest
@@ -1756,19 +1747,6 @@ tasks:
- docker-compose build ubuntu-ruby
- docker-compose run ubuntu-ruby
- test-conda-python-2.7:
- ci: circle
- platform: linux
- template: docker-tests/circle.linux.yml
- params:
- commands:
- - export PYTHON=2.7
- - docker-compose pull --ignore-pull-failures conda-cpp
- - docker-compose pull --ignore-pull-failures conda-python
- - docker-compose build conda-cpp
- - docker-compose build conda-python
- - docker-compose run conda-python
-
test-conda-python-3.6:
ci: circle
platform: linux
@@ -1965,20 +1943,6 @@ tasks:
############################## Integration tests ############################
- test-conda-python-2.7-pandas-latest:
- ci: circle
- platform: linux
- template: docker-tests/circle.linux.yml
- params:
- commands:
- - export PYTHON=2.7 PANDAS=latest
- - docker-compose pull --ignore-pull-failures conda-cpp
- - docker-compose pull --ignore-pull-failures conda-python
- - docker-compose build conda-cpp
- - docker-compose build conda-python
- - docker-compose build --no-cache conda-python-pandas
- - docker-compose run conda-python-pandas
-
test-conda-python-3.7-pandas-latest:
ci: circle
platform: linux
diff --git a/docker-compose.yml b/docker-compose.yml
index 4f2f14a75e..10ddc342d2 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -411,7 +411,7 @@ services:
# docker-compose run --rm conda-python
# Parameters:
# ARCH: amd64, arm32v7
- # PYTHON: 2.7, 3.6, 3.7, 3.8
+ # PYTHON: 3.6, 3.7, 3.8
image: ${REPO}:${ARCH}-conda-python-${PYTHON}
build:
context: .