Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-37880: [CI][Python][Packaging] Add support for Python 3.12 #37901

Merged
merged 30 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
30e1b44
GH-37880: [CI][Python][Packaging] Add support for Python 3.12
raulcd Sep 27, 2023
137f67f
Fix elif on bash for installing Python on macOS
raulcd Sep 27, 2023
4f0b91e
Test wheels with 3.12.0rc3
raulcd Sep 27, 2023
78df35d
Update Pypa image for manylinux 2_28
raulcd Sep 27, 2023
3214e39
pip install upgrade setuptools too
raulcd Sep 27, 2023
2f7c525
Try with numpy 1.26 for Python 3.12
raulcd Sep 27, 2023
5dea526
Require latest numpy for Python 3.12
raulcd Sep 27, 2023
4f6ab1d
Use latest GCS to see if it fixes CI
raulcd Sep 27, 2023
f127bd1
Temporarily disable install_gcs_testbench
raulcd Sep 27, 2023
e0fcfa6
Move from Python 3.12 RC3 to 3.12.0 released version
raulcd Oct 3, 2023
8b872bd
Minor patch to fix issue with llvm when building gandiva feature
raulcd Oct 3, 2023
48486ec
Use a newer version of Python to install Google Cloud Storage Testbench
raulcd Oct 3, 2023
2d4acc0
Temporary increase timeout of Java JNI to rebuild vcpkg image using t…
raulcd Oct 3, 2023
64a3c0e
Free up disk space
raulcd Oct 3, 2023
2251ec6
Re-enable gcs testbench
raulcd Oct 4, 2023
2facafc
Revert "Re-enable gcs testbench"
raulcd Oct 4, 2023
e7b4e77
Update GCS testbench to latest release
raulcd Oct 10, 2023
dcf4b3b
Enable GCS testbench with newer available version
raulcd Oct 10, 2023
8043a6a
Upgrade setuptools
raulcd Oct 10, 2023
4116e74
Simplify Wheel test requirements for numpy dependencies removing plat…
raulcd Oct 10, 2023
0d280cc
Use pipx to install gcs-testbench
raulcd Oct 10, 2023
54734dd
Revert "Use pipx to install gcs-testbench"
raulcd Oct 10, 2023
1535c98
Remove setuptools update
raulcd Oct 10, 2023
8d49c8b
Update setuptools to fix really old ARM setuptools
raulcd Oct 10, 2023
72ea362
Use pip3 instead of pip for Ubuntu 20.04
raulcd Oct 10, 2023
268b13a
Remove unnecessary pip symbolic link
raulcd Oct 10, 2023
e1203ff
Do not update pip to do not mess up with other jobs
raulcd Oct 10, 2023
790d950
Do not update setuptools if not necessary
raulcd Oct 10, 2023
e1369db
Install archery in command
raulcd Oct 10, 2023
27a979c
Use Python 3.10.11 version that contains the Macos .pkg
raulcd Oct 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ jobs:
run: |
$(brew --prefix bash)/bin/bash \
ci/scripts/install_minio.sh latest /usr/local
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Google Cloud Storage Testbench
run: ci/scripts/install_gcs_testbench.sh default
- name: Install Azurite Storage Emulator
Expand Down Expand Up @@ -427,6 +431,10 @@ jobs:
--output-document /usr/local/bin/minio.exe \
https://dl.min.io/server/minio/release/windows-amd64/archive/minio.RELEASE.2022-05-26T05-48-41Z
chmod +x /usr/local/bin/minio.exe
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Google Cloud Storage Testbench
shell: bash
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/java_jni.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ jobs:
name: AMD64 manylinux2014 Java JNI
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 90
timeout-minutes: 500
steps:
- name: Checkout Arrow
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Free up disk space
run: |
ci/scripts/util_free_space.sh
- name: Cache Docker Volumes
uses: actions/cache@v3
with:
Expand Down
5 changes: 3 additions & 2 deletions ci/docker/python-wheel-windows-test-vs2017.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ RUN wmic product where "name like 'python%%'" call uninstall /nointeractive && \
ARG python=3.8
RUN (if "%python%"=="3.8" setx PYTHON_VERSION "3.8.10" && setx PATH "%PATH%;C:\Python38;C:\Python38\Scripts") & \
(if "%python%"=="3.9" setx PYTHON_VERSION "3.9.13" && setx PATH "%PATH%;C:\Python39;C:\Python39\Scripts") & \
(if "%python%"=="3.10" setx PYTHON_VERSION "3.10.8" && setx PATH "%PATH%;C:\Python310;C:\Python310\Scripts") & \
(if "%python%"=="3.11" setx PYTHON_VERSION "3.11.0" && setx PATH "%PATH%;C:\Python311;C:\Python311\Scripts")
(if "%python%"=="3.10" setx PYTHON_VERSION "3.10.11" && setx PATH "%PATH%;C:\Python310;C:\Python310\Scripts") & \
(if "%python%"=="3.11" setx PYTHON_VERSION "3.11.5" && setx PATH "%PATH%;C:\Python311;C:\Python311\Scripts") & \
(if "%python%"=="3.12" setx PYTHON_VERSION "3.12.0" && setx PATH "%PATH%;C:\Python312;C:\Python312\Scripts")
RUN choco install -r -y --no-progress python --version=%PYTHON_VERSION%
RUN python -m pip install -U pip setuptools
5 changes: 3 additions & 2 deletions ci/docker/python-wheel-windows-vs2017.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ RUN wmic product where "name like 'python%%'" call uninstall /nointeractive && \
ARG python=3.8
RUN (if "%python%"=="3.8" setx PYTHON_VERSION "3.8.10" && setx PATH "%PATH%;C:\Python38;C:\Python38\Scripts") & \
(if "%python%"=="3.9" setx PYTHON_VERSION "3.9.13" && setx PATH "%PATH%;C:\Python39;C:\Python39\Scripts") & \
(if "%python%"=="3.10" setx PYTHON_VERSION "3.10.8" && setx PATH "%PATH%;C:\Python310;C:\Python310\Scripts") & \
(if "%python%"=="3.11" setx PYTHON_VERSION "3.11.0" && setx PATH "%PATH%;C:\Python311;C:\Python311\Scripts")
(if "%python%"=="3.10" setx PYTHON_VERSION "3.10.11" && setx PATH "%PATH%;C:\Python310;C:\Python310\Scripts") & \
(if "%python%"=="3.11" setx PYTHON_VERSION "3.11.5" && setx PATH "%PATH%;C:\Python311;C:\Python311\Scripts") & \
(if "%python%"=="3.12" setx PYTHON_VERSION "3.12.0" && setx PATH "%PATH%;C:\Python312;C:\Python312\Scripts")
RUN choco install -r -y --no-progress python --version=%PYTHON_VERSION%
RUN python -m pip install -U pip setuptools

Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/install_gcs_testbench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ esac

version=$1
if [[ "${version}" -eq "default" ]]; then
version="v0.36.0"
version="v0.39.0"
fi

${PYTHON:-python3} -m pip install \
Expand Down
7 changes: 4 additions & 3 deletions ci/scripts/install_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ platforms=([windows]=Windows
declare -A versions
versions=([3.8]=3.8.10
[3.9]=3.9.13
[3.10]=3.10.8
[3.11]=3.11.0)
[3.10]=3.10.13
[3.11]=3.11.5
[3.12]=3.12.0)

if [ "$#" -ne 2 ]; then
echo "Usage: $0 <platform> <version>"
Expand All @@ -45,7 +46,7 @@ full_version=${versions[$2]}
if [ $platform = "MacOSX" ]; then
echo "Downloading Python installer..."

if [ "$(uname -m)" = "arm64" ] || [ "$version" = "3.10" ] || [ "$version" = "3.11" ]; then
if [ "$(uname -m)" = "arm64" ] || [ "$version" = "3.10" ] || [ "$version" = "3.11" ] || [ "$version" = "3.12" ]; then
fname="python-${full_version}-macos11.pkg"
else
fname="python-${full_version}-macosx10.9.pkg"
Expand Down
13 changes: 13 additions & 0 deletions ci/vcpkg/ports.patch
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,16 @@ index 0000000..a57ce0c
+ }
+
+ static inline bool LeftShiftOverflows(uint8_t value, uint32_t shift) {
diff --git a/ports/llvm/portfile.cmake b/ports/llvm/portfile.cmake
index 4d7e26a..1f054a2 100644
--- a/ports/llvm/portfile.cmake
+++ b/ports/llvm/portfile.cmake
@@ -274,6 +274,8 @@ vcpkg_cmake_configure(
COMPILER_RT_ENABLE_IOS
OPENMP_TOOLS_INSTALL_DIR
MLIR_TOOLS_INSTALL_DIR
+ BOLT_TOOLS_INSTALL_DIR
+ LIBOMP_INSTALL_ALIASES
)

vcpkg_cmake_install(ADD_BIN_TO_PATH)
6 changes: 3 additions & 3 deletions dev/release/verify-release-candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ test_linux_wheels() {
local arch="x86_64"
fi

local python_versions="${TEST_PYTHON_VERSIONS:-3.8 3.9 3.10 3.11}"
local python_versions="${TEST_PYTHON_VERSIONS:-3.8 3.9 3.10 3.11 3.12}"
local platform_tags="${TEST_WHEEL_PLATFORM_TAGS:-manylinux_2_17_${arch}.manylinux2014_${arch} manylinux_2_28_${arch}}"

for python in ${python_versions}; do
Expand All @@ -1059,11 +1059,11 @@ test_macos_wheels() {

# apple silicon processor
if [ "$(uname -m)" = "arm64" ]; then
local python_versions="3.8 3.9 3.10 3.11"
local python_versions="3.8 3.9 3.10 3.11 3.12"
local platform_tags="macosx_11_0_arm64"
local check_flight=OFF
else
local python_versions="3.8 3.9 3.10 3.11"
local python_versions="3.8 3.9 3.10 3.11 3.12"
local platform_tags="macosx_10_14_x86_64"
fi

Expand Down
2 changes: 1 addition & 1 deletion dev/tasks/python-wheels/github.osx.amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
run: |
$PYTHON -m venv test-amd64-env
source test-amd64-env/bin/activate
pip install --upgrade pip wheel
pip install --upgrade setuptools pip wheel
arch -x86_64 pip install -r arrow/python/requirements-wheel-test.txt
PYTHON=python arch -x86_64 arrow/ci/scripts/install_gcs_testbench.sh default
arch -x86_64 arrow/ci/scripts/python_wheel_unix_test.sh $(pwd)/arrow
Expand Down
6 changes: 3 additions & 3 deletions dev/tasks/python-wheels/github.osx.arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ jobs:
run: |
$PYTHON -m venv test-arm64-env
source test-arm64-env/bin/activate
pip install --upgrade pip wheel
pip install --upgrade setuptools pip wheel
# libffi has to be installed on the m1 runner which causes issues with
# the cffi wheel. We build cffi with the flags pointing to the correct libffi location.
LDFLAGS=-L$(brew --prefix libffi)/lib CFLAGS=-I$(brew --prefix libffi)/include \
pip install cffi --no-binary :all:
pip install -r arrow/python/requirements-wheel-test.txt
pip install -r arrow/python/requirements-wheel-test.txt
PYTHON=python arrow/ci/scripts/install_gcs_testbench.sh default
arrow/ci/scripts/python_wheel_unix_test.sh $(pwd)/arrow
arrow/ci/scripts/python_wheel_unix_test.sh $(pwd)/arrow

- name: Upload artifacts
shell: bash
Expand Down
7 changes: 4 additions & 3 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,8 @@ tasks:
{% for python_version, python_tag, abi_tag in [("3.8", "cp38", "cp38"),
("3.9", "cp39", "cp39"),
("3.10", "cp310", "cp310"),
("3.11", "cp311", "cp311")] %}
("3.11", "cp311", "cp311"),
("3.12", "cp312", "cp312")] %}

{############################## Wheel Linux ##################################}

Expand Down Expand Up @@ -533,7 +534,7 @@ tasks:
artifacts:
- pyarrow-{no_rc_version}-cp38-cp38-macosx_11_0_arm64.whl

{% for python_version, python_tag in [("3.9", "cp39"), ("3.10", "cp310"), ("3.11", "cp311")] %}
{% for python_version, python_tag in [("3.9", "cp39"), ("3.10", "cp310"), ("3.11", "cp311"), ("3.12", "cp312")] %}
wheel-macos-big-sur-{{ python_tag }}-arm64:
ci: github
template: python-wheels/github.osx.arm64.yml
Expand Down Expand Up @@ -1233,7 +1234,7 @@ tasks:
flags: "-e ARROW_CSV=ON -e ARROW_PARQUET=ON"
image: ubuntu-cpp-minimal

{% for python_version in ["3.8", "3.9", "3.10", "3.11"] %}
{% for python_version in ["3.8", "3.9", "3.10", "3.11", "3.12"] %}
test-conda-python-{{ python_version }}:
ci: github
template: docker-tests/github.linux.yml
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ services:
args:
arch: ${ARCH}
arch_short: ${ARCH_SHORT}
base: quay.io/pypa/manylinux2014_${ARCH_ALIAS}:2022-10-25-fbea779
base: quay.io/pypa/manylinux2014_${ARCH_ALIAS}:2023-10-03-72cdc42
vcpkg: ${VCPKG}
python: ${PYTHON}
manylinux: 2014
Expand All @@ -1056,7 +1056,7 @@ services:
args:
arch: ${ARCH}
arch_short: ${ARCH_SHORT}
base: quay.io/pypa/manylinux_2_28_${ARCH_ALIAS}:2023-01-14-103cb93
base: quay.io/pypa/manylinux_2_28_${ARCH_ALIAS}:2023-10-03-72cdc42
vcpkg: ${VCPKG}
python: ${PYTHON}
manylinux: 2_28
Expand Down
15 changes: 10 additions & 5 deletions python/requirements-wheel-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,23 @@ pytz
tzdata; sys_platform == 'win32'

numpy==1.21.3; platform_system == "Linux" and platform_machine == "aarch64" and python_version < "3.11"
numpy==1.23.4; platform_system == "Linux" and platform_machine == "aarch64" and python_version >= "3.11"
numpy==1.23.4; platform_system == "Linux" and platform_machine == "aarch64" and python_version == "3.11"
numpy==1.26.0; platform_system == "Linux" and platform_machine == "aarch64" and python_version >= "3.12"
numpy==1.19.5; platform_system == "Linux" and platform_machine != "aarch64" and python_version < "3.9"
numpy==1.21.3; platform_system == "Linux" and platform_machine != "aarch64" and python_version >= "3.9" and python_version < "3.11"
numpy==1.23.4; platform_system == "Linux" and platform_machine != "aarch64" and python_version >= "3.11"
numpy==1.23.4; platform_system == "Linux" and platform_machine != "aarch64" and python_version == "3.11"
numpy==1.26.0; platform_system == "Linux" and platform_machine != "aarch64" and python_version >= "3.11"
numpy==1.21.3; platform_system == "Darwin" and platform_machine == "arm64" and python_version < "3.11"
numpy==1.23.4; platform_system == "Darwin" and platform_machine == "arm64" and python_version >= "3.11"
numpy==1.23.4; platform_system == "Darwin" and platform_machine == "arm64" and python_version == "3.11"
numpy==1.26.0; platform_system == "Darwin" and platform_machine == "arm64" and python_version >= "3.12"
numpy==1.19.5; platform_system == "Darwin" and platform_machine != "arm64" and python_version < "3.9"
numpy==1.21.3; platform_system == "Darwin" and platform_machine != "arm64" and python_version >= "3.9" and python_version < "3.11"
numpy==1.23.4; platform_system == "Darwin" and platform_machine != "arm64" and python_version >= "3.11"
numpy==1.23.4; platform_system == "Darwin" and platform_machine != "arm64" and python_version == "3.11"
numpy==1.26.0; platform_system == "Darwin" and platform_machine != "arm64" and python_version >= "3.12"
numpy==1.19.5; platform_system == "Windows" and python_version < "3.9"
numpy==1.21.3; platform_system == "Windows" and python_version >= "3.9" and python_version < "3.11"
numpy==1.23.4; platform_system == "Windows" and python_version >= "3.11"
numpy==1.23.4; platform_system == "Windows" and python_version == "3.11"
numpy==1.26.0; platform_system == "Windows" and python_version >= "3.12"
raulcd marked this conversation as resolved.
Show resolved Hide resolved

pandas<1.1.0; platform_system == "Linux" and platform_machine != "aarch64" and python_version < "3.8"
pandas; platform_system == "Linux" and platform_machine != "aarch64" and python_version >= "3.8"
Expand Down
1 change: 1 addition & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ def has_ext_modules(foo):
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
license='Apache License, Version 2.0',
maintainer='Apache Arrow Developers',
Expand Down
Loading