From 69ba5710829c584af3a82e19965daba4361c2f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Mon, 13 Jan 2025 12:37:44 +0100 Subject: [PATCH] GH-45237: [Python] Raise minimum supported cython to >=3 --- ci/conda_env_python.txt | 2 +- ci/docker/conda-python-cython2.dockerfile | 24 ---------------------- docker-compose.yml | 25 ----------------------- python/pyproject.toml | 2 +- python/requirements-build.txt | 2 +- python/requirements-wheel-build.txt | 2 +- python/setup.py | 4 ++-- 7 files changed, 6 insertions(+), 55 deletions(-) delete mode 100644 ci/docker/conda-python-cython2.dockerfile diff --git a/ci/conda_env_python.txt b/ci/conda_env_python.txt index bf915493de302..b467cc1ddd3b4 100644 --- a/ci/conda_env_python.txt +++ b/ci/conda_env_python.txt @@ -18,7 +18,7 @@ # don't add pandas here, because it is not a mandatory test dependency boto3 # not a direct dependency of s3fs, but needed for our s3fs fixture cffi -cython>=0.29.31 +cython>=3 cloudpickle fsspec hypothesis diff --git a/ci/docker/conda-python-cython2.dockerfile b/ci/docker/conda-python-cython2.dockerfile deleted file mode 100644 index 859ad868b0c71..0000000000000 --- a/ci/docker/conda-python-cython2.dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -ARG repo -ARG arch -ARG python=3.9 -FROM ${repo}:${arch}-conda-python-${python} - -RUN mamba install -q -y "cython<3" && \ - mamba clean --all diff --git a/docker-compose.yml b/docker-compose.yml index 43dd3511fcf18..a13072346120c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -123,7 +123,6 @@ x-hierarchy: - conda-python-pandas: - conda-python-docs - conda-python-cpython-debug - - conda-python-cython2 - conda-python-dask - conda-python-emscripten - conda-python-hdfs @@ -1499,30 +1498,6 @@ services: /arrow/ci/scripts/python_build.sh /arrow /build && /arrow/ci/scripts/integration_substrait.sh"] - conda-python-cython2: - # Usage: - # docker compose build conda - # docker compose build conda-cpp - # docker compose build conda-python - # docker compose build conda-python-cython2 - # docker compose run --rm conda-python-cython2 - image: ${REPO}:${ARCH}-conda-python-${PYTHON}-cython2 - build: - context: . - dockerfile: ci/docker/conda-python-cython2.dockerfile - cache_from: - - ${REPO}:${ARCH}-conda-python-${PYTHON}-cython2 - args: - repo: ${REPO} - arch: ${ARCH} - python: ${PYTHON} - shm_size: *shm-size - environment: - <<: [*common, *ccache] - PYTEST_ARGS: # inherit - volumes: *conda-volumes - command: *python-conda-command - conda-python-cpython-debug: # Usage: # docker compose build conda diff --git a/python/pyproject.toml b/python/pyproject.toml index 85bdbec0915ed..be7c167267027 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -17,7 +17,7 @@ [build-system] requires = [ - "cython >= 0.29.31", + "cython >= 3", # Starting with NumPy 1.25, NumPy is (by default) as far back compatible # as oldest-support-numpy was (customizable with a NPY_TARGET_VERSION # define). For older Python versions (where NumPy 1.25 is not yet available) diff --git a/python/requirements-build.txt b/python/requirements-build.txt index c150c842a0cc6..00b523ee52120 100644 --- a/python/requirements-build.txt +++ b/python/requirements-build.txt @@ -1,4 +1,4 @@ -cython>=0.29.31 +cython>=3 oldest-supported-numpy>=0.14; python_version<'3.9' numpy>=1.25; python_version>='3.9' setuptools_scm>=8 diff --git a/python/requirements-wheel-build.txt b/python/requirements-wheel-build.txt index faa078d3d7fe7..38e59ce45ab8e 100644 --- a/python/requirements-wheel-build.txt +++ b/python/requirements-wheel-build.txt @@ -1,4 +1,4 @@ -cython>=0.29.31 +cython>=3 oldest-supported-numpy>=0.14; python_version<'3.9' numpy>=2.0.0; python_version>='3.9' setuptools_scm diff --git a/python/setup.py b/python/setup.py index 60b9a696d9785..bd658b91a53a5 100755 --- a/python/setup.py +++ b/python/setup.py @@ -48,9 +48,9 @@ ) -if Cython.__version__ < '0.29.31': +if Cython.__version__ < '3': raise Exception( - 'Please update your Cython version. Supported Cython >= 0.29.31') + 'Please update your Cython version. Supported Cython >= 3') setup_dir = os.path.abspath(os.path.dirname(__file__))