This is an automated email from the ASF dual-hosted git repository.
raulcd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 2c2a61c7e5 GH-49566: [Python] Skip header files when installing
compiled Cython files and other Python release verification fixes (#49571)
2c2a61c7e5 is described below
commit 2c2a61c7e5e4c8f9db38e72f539bb3deb7491dc9
Author: Alenka Frim <[email protected]>
AuthorDate: Wed Mar 25 10:51:00 2026 +0100
GH-49566: [Python] Skip header files when installing compiled Cython files
and other Python release verification fixes (#49571)
### Rationale for this change
Local import is broken when doing editable install with scikit-build-core,
also nightly verification jobs are failing for the same reason.
### What changes are included in this PR?
- `lib.h` and `lib_api.h` are already installed separately so we skip them
when installing Cython extensions into the output destination
(`side-packages/pyarrow`).
- Arrow library directory is added to the `RPATH`, in the case of not
bundling ARROW_CPP, to fix linking issues on macos
- `test_pyarrow_include` is updated due to compiled files now being moved
to the site-packages
- updates to the release verification script when building pyarrow
- update of `brew` on the "Install System Dependencies" step in the rc
verification job to fix an issue with protobuf mixed versions
### Are these changes tested?
Yes, locally and via the extended verification builds.
### Are there any user-facing changes?
No.
* GitHub Issue: #49566
Lead-authored-by: Raúl Cumplido <[email protected]>
Co-authored-by: AlenkaF <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
---
dev/release/verify-release-candidate.sh | 12 ++++++------
dev/tasks/verify-rc/github.macos.yml | 4 ++++
python/CMakeLists.txt | 12 ++++++++++++
python/pyarrow/tests/test_cpp_internals.py | 5 ++---
4 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/dev/release/verify-release-candidate.sh
b/dev/release/verify-release-candidate.sh
index f91b8de474..9e7deb2372 100755
--- a/dev/release/verify-release-candidate.sh
+++ b/dev/release/verify-release-candidate.sh
@@ -538,7 +538,7 @@ test_python() {
show_header "Build and test Python libraries"
# Build and test Python
- maybe_setup_virtualenv
+ maybe_setup_virtualenv -r python/requirements-build.txt
maybe_setup_conda --file ci/conda_env_python.txt
if [ "${USE_CONDA}" -gt 0 ]; then
@@ -570,7 +570,9 @@ test_python() {
pushd python
# Build pyarrow
- python -m pip install -e .
+ python -m pip install --no-build-isolation .
+
+ popd
# Check mandatory and optional imports
python -c "
@@ -601,12 +603,10 @@ import pyarrow.parquet
# Install test dependencies
- pip install -r requirements-test.txt
+ pip install -r python/requirements-test.txt
# Execute pyarrow unittests
- pytest pyarrow -v
-
- popd
+ pytest --pyargs pyarrow -v
}
test_glib() {
diff --git a/dev/tasks/verify-rc/github.macos.yml
b/dev/tasks/verify-rc/github.macos.yml
index d20d78307b..207fef2918 100644
--- a/dev/tasks/verify-rc/github.macos.yml
+++ b/dev/tasks/verify-rc/github.macos.yml
@@ -50,6 +50,10 @@ jobs:
brew uninstall [email protected] || :
{% endif %}
+ # Workaround for https://github.com/grpc/grpc/issues/41755
+ # Remove once the runner ships a newer Homebrew.
+ brew update
+
brew bundle --file=arrow/cpp/Brewfile
brew bundle --file=arrow/c_glib/Brewfile
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 6395b3e1e7..bfbcd13141 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -293,6 +293,15 @@ message(STATUS "Found Cython version: ${CYTHON_VERSION}")
include(GNUInstallDirs)
find_package(Arrow REQUIRED)
+# When not bundling Arrow C++ libraries on macOS, add the Arrow library
+# directory to the RPATH so that the extensions can find libarrow at runtime.
+if(APPLE
+ AND NOT PYARROW_BUNDLE_ARROW_CPP
+ AND ARROW_SHARED_LIB)
+ get_filename_component(_arrow_lib_dir "${ARROW_SHARED_LIB}" DIRECTORY)
+ list(APPEND CMAKE_INSTALL_RPATH "${_arrow_lib_dir}")
+endif()
+
macro(define_option name description arrow_option)
set("PYARROW_${name}"
"AUTO"
@@ -968,6 +977,9 @@ foreach(module ${CYTHON_EXTENSIONS})
continue()
endif()
endif()
+ if(output MATCHES "\\.h$")
+ continue()
+ endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${output} DESTINATION ".")
endforeach()
endforeach()
diff --git a/python/pyarrow/tests/test_cpp_internals.py
b/python/pyarrow/tests/test_cpp_internals.py
index 7508d8f0b9..fbbf95e81b 100644
--- a/python/pyarrow/tests/test_cpp_internals.py
+++ b/python/pyarrow/tests/test_cpp_internals.py
@@ -49,9 +49,8 @@ def test_pyarrow_include():
# created. Either with PyArrow C++ header files or with
# Arrow C++ and PyArrow C++ header files together
- source = os.path.dirname(os.path.abspath(__file__))
- pyarrow_dir = pjoin(source, '..')
- pyarrow_include = pjoin(pyarrow_dir, 'include')
+ import pyarrow
+ pyarrow_include = pyarrow.get_include()
pyarrow_cpp_include = pjoin(pyarrow_include, 'arrow', 'python')
assert os.path.exists(pyarrow_include)