From ebe56cf5922ce5f53885e824d1bfdfb9adb084b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Wed, 27 Sep 2023 13:26:22 +0200 Subject: [PATCH] GH-37880: [CI][Python][Packaging] Add support for Python 3.12 --- ci/docker/python-wheel-windows-test-vs2017.dockerfile | 7 ++++--- ci/docker/python-wheel-windows-vs2017.dockerfile | 7 ++++--- ci/scripts/install_python.sh | 7 +++++-- dev/release/verify-release-candidate.sh | 6 +++--- dev/tasks/tasks.yml | 7 ++++--- docker-compose.yml | 2 +- python/setup.py | 1 + 7 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ci/docker/python-wheel-windows-test-vs2017.dockerfile b/ci/docker/python-wheel-windows-test-vs2017.dockerfile index 4aa5363ff7d62..4f5f24549892c 100644 --- a/ci/docker/python-wheel-windows-test-vs2017.dockerfile +++ b/ci/docker/python-wheel-windows-test-vs2017.dockerfile @@ -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") -RUN choco install -r -y --no-progress python --version=%PYTHON_VERSION% + (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-rc3" && setx PATH "%PATH%;C:\Python312;C:\Python312\Scripts") +RUN choco install -r -y --no-progress python --pre --version=%PYTHON_VERSION% RUN python -m pip install -U pip setuptools diff --git a/ci/docker/python-wheel-windows-vs2017.dockerfile b/ci/docker/python-wheel-windows-vs2017.dockerfile index 531c4e678fafe..b68dea9aea2a9 100644 --- a/ci/docker/python-wheel-windows-vs2017.dockerfile +++ b/ci/docker/python-wheel-windows-vs2017.dockerfile @@ -81,9 +81,10 @@ 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") -RUN choco install -r -y --no-progress python --version=%PYTHON_VERSION% + (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-rc3" && setx PATH "%PATH%;C:\Python312;C:\Python312\Scripts") +RUN choco install -r -y --no-progress python --pre --version=%PYTHON_VERSION% RUN python -m pip install -U pip setuptools COPY python/requirements-wheel-build.txt arrow/python/ diff --git a/ci/scripts/install_python.sh b/ci/scripts/install_python.sh index 599c238c97803..7a3827fdfa3f7 100755 --- a/ci/scripts/install_python.sh +++ b/ci/scripts/install_python.sh @@ -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 " @@ -47,6 +48,8 @@ if [ $platform = "MacOSX" ]; then if [ "$(uname -m)" = "arm64" ] || [ "$version" = "3.10" ] || [ "$version" = "3.11" ]; then fname="python-${full_version}-macos11.pkg" + else if [ "$version" = "3.12" ]; then + fname="python-3.12.0rc3-macos11.pkg" else fname="python-${full_version}-macosx10.9.pkg" fi diff --git a/dev/release/verify-release-candidate.sh b/dev/release/verify-release-candidate.sh index ae28ebe792404..475ddf619ef1d 100755 --- a/dev/release/verify-release-candidate.sh +++ b/dev/release/verify-release-candidate.sh @@ -1020,7 +1020,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 @@ -1042,11 +1042,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 diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index 859ff8ddb5b44..8eb4336120316 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -475,7 +475,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 ##################################} @@ -541,7 +542,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 @@ -1255,7 +1256,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 diff --git a/docker-compose.yml b/docker-compose.yml index 62e5aee0a841c..11390d42be668 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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-09-24-36b93e4 vcpkg: ${VCPKG} python: ${PYTHON} manylinux: 2014 diff --git a/python/setup.py b/python/setup.py index 062aac307b1e4..0cef947821696 100755 --- a/python/setup.py +++ b/python/setup.py @@ -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',