From 7873a1402b45998947cda22ece581d3c42ce3ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Tue, 10 Jun 2025 11:13:13 +0200 Subject: [PATCH 1/5] GH-46516: [CI][Python] Force Cython>3.1.1 if BUILD_DOCS_PYTHON=ON --- ci/scripts/python_build.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ci/scripts/python_build.sh b/ci/scripts/python_build.sh index 9455baf35363..99c1bbffa705 100755 --- a/ci/scripts/python_build.sh +++ b/ci/scripts/python_build.sh @@ -78,6 +78,13 @@ export PYARROW_PARALLEL=${n_jobs} export CMAKE_PREFIX_PATH export LD_LIBRARY_PATH=${ARROW_HOME}/lib:${LD_LIBRARY_PATH} +# https://github.com/apache/arrow/issues/46516 +# If we are building docs we force Cython>3.1.1 to avoid numpydoc +# failures due to Cython docstring being wrongly generated. +if [ "${BUILD_DOCS_PYTHON}" == "ON" ]; then + ${PYTHON:-python} -m pip install Cython>3.1.1 +fi + # https://github.com/apache/arrow/issues/41429 # TODO: We want to out-of-source build. This is a workaround. We copy # all needed files to the build directory from the source directory From a585118d37e613f2979da577e0505f3d3222ae56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Tue, 10 Jun 2025 12:26:23 +0200 Subject: [PATCH 2/5] Fix doctset --- python/pyarrow/types.pxi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyarrow/types.pxi b/python/pyarrow/types.pxi index fcd150725a3a..5aab82bbf660 100644 --- a/python/pyarrow/types.pxi +++ b/python/pyarrow/types.pxi @@ -4464,7 +4464,7 @@ def float16(): to a python list, the types of its elements will be ``np.float16`` >>> [type(val) for val in a.to_pylist()] - [, ] + [, ] """ return primitive_type(_Type_HALF_FLOAT) From 9ae6a91bc11b67543a85b9b68352d71732030e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Tue, 10 Jun 2025 12:27:12 +0200 Subject: [PATCH 3/5] Use --upgrade for conda cases where cython might have been installed already --- ci/scripts/python_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/scripts/python_build.sh b/ci/scripts/python_build.sh index 99c1bbffa705..941907f25c97 100755 --- a/ci/scripts/python_build.sh +++ b/ci/scripts/python_build.sh @@ -82,7 +82,7 @@ export LD_LIBRARY_PATH=${ARROW_HOME}/lib:${LD_LIBRARY_PATH} # If we are building docs we force Cython>3.1.1 to avoid numpydoc # failures due to Cython docstring being wrongly generated. if [ "${BUILD_DOCS_PYTHON}" == "ON" ]; then - ${PYTHON:-python} -m pip install Cython>3.1.1 + ${PYTHON:-python} -m pip install --upgrade Cython>3.1.1 fi # https://github.com/apache/arrow/issues/41429 From 574017c16d63b0ab324d59130e13a6cc87b00e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Tue, 10 Jun 2025 13:28:34 +0200 Subject: [PATCH 4/5] Remove pip install for Cython 3.1.2 and add pin on docs/requirements.txt and conda_env_sphinx --- ci/conda_env_sphinx.txt | 1 + ci/scripts/python_build.sh | 7 ------- docs/requirements.txt | 1 + 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/ci/conda_env_sphinx.txt b/ci/conda_env_sphinx.txt index 840577fdd97a..6e018a30781e 100644 --- a/ci/conda_env_sphinx.txt +++ b/ci/conda_env_sphinx.txt @@ -18,6 +18,7 @@ # Requirements for building the documentation breathe doxygen +cython>3.1.1 ipython linkify-it-py # We can't install linuxdoc by conda. We install linuxdoc by pip in diff --git a/ci/scripts/python_build.sh b/ci/scripts/python_build.sh index 941907f25c97..9455baf35363 100755 --- a/ci/scripts/python_build.sh +++ b/ci/scripts/python_build.sh @@ -78,13 +78,6 @@ export PYARROW_PARALLEL=${n_jobs} export CMAKE_PREFIX_PATH export LD_LIBRARY_PATH=${ARROW_HOME}/lib:${LD_LIBRARY_PATH} -# https://github.com/apache/arrow/issues/46516 -# If we are building docs we force Cython>3.1.1 to avoid numpydoc -# failures due to Cython docstring being wrongly generated. -if [ "${BUILD_DOCS_PYTHON}" == "ON" ]; then - ${PYTHON:-python} -m pip install --upgrade Cython>3.1.1 -fi - # https://github.com/apache/arrow/issues/41429 # TODO: We want to out-of-source build. This is a workaround. We copy # all needed files to the build directory from the source directory diff --git a/docs/requirements.txt b/docs/requirements.txt index 493528fb5c72..a97781bc97a7 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,6 +3,7 @@ # breathe +cython>3.1.1 ipython linuxdoc myst-parser[linkify] From 30263d0e583242f67fa0bd293a59cf67b0d13a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Tue, 10 Jun 2025 15:54:53 +0200 Subject: [PATCH 5/5] Update alphabetical order --- ci/conda_env_sphinx.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/conda_env_sphinx.txt b/ci/conda_env_sphinx.txt index 6e018a30781e..1ab23918bb6b 100644 --- a/ci/conda_env_sphinx.txt +++ b/ci/conda_env_sphinx.txt @@ -17,8 +17,8 @@ # Requirements for building the documentation breathe -doxygen cython>3.1.1 +doxygen ipython linkify-it-py # We can't install linuxdoc by conda. We install linuxdoc by pip in