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 ab0c857695 GH-44578: [Release][Packaging] Verify wheel version (#44593)
ab0c857695 is described below

commit ab0c857695420f94cc83259494941a68b2762dee
Author: Sutou Kouhei <[email protected]>
AuthorDate: Sun Nov 3 00:31:06 2024 +0900

    GH-44578: [Release][Packaging] Verify wheel version (#44593)
    
    ### Rationale for this change
    
    We want to detect binary build from wrong source.
    
    ### What changes are included in this PR?
    
    Add version check. If we use wrong source, binary's version is 
`X.Y.Z-SNAPSHOT` not `X.Y.Z`. So the added check is failed.
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    No.
    * GitHub Issue: #44578
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Raúl Cumplido <[email protected]>
---
 ci/scripts/python_wheel_unix_test.sh    |  7 +++++++
 dev/release/verify-release-candidate.sh | 27 ++++++++++++++++++++++++---
 2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/ci/scripts/python_wheel_unix_test.sh 
b/ci/scripts/python_wheel_unix_test.sh
index 1487581eae..3ce86b1611 100755
--- a/ci/scripts/python_wheel_unix_test.sh
+++ b/ci/scripts/python_wheel_unix_test.sh
@@ -88,6 +88,13 @@ import pyarrow.parquet
   fi
 fi
 
+if [ "${CHECK_VERSION}" == "ON" ]; then
+  pyarrow_version=$(python -c "import pyarrow; print(pyarrow.__version__)")
+  [ "${pyarrow_version}" = "${ARROW_VERSION}" ]
+  arrow_cpp_version=$(python -c "import pyarrow; 
print(pyarrow.cpp_build_info.version)")
+  [ "${arrow_cpp_version}" = "${ARROW_VERSION}" ]
+fi
+
 if [ "${CHECK_WHEEL_CONTENT}" == "ON" ]; then
   python ${source_dir}/ci/scripts/python_wheel_validate_contents.py \
     --path ${source_dir}/python/repaired_wheels
diff --git a/dev/release/verify-release-candidate.sh 
b/dev/release/verify-release-candidate.sh
index d9f973562a..17d10601d1 100755
--- a/dev/release/verify-release-candidate.sh
+++ b/dev/release/verify-release-candidate.sh
@@ -1052,6 +1052,12 @@ test_linux_wheels() {
     local wheel_content="OFF"
   fi
 
+  if [ "${SOURCE_KIND}" = "tarball" ]; then
+    local check_version="ON"
+  else
+    local check_version="OFF"
+  fi
+
   for python in ${python_versions}; do
     local pyver=${python/m}
     for platform in ${platform_tags}; do
@@ -1061,7 +1067,11 @@ test_linux_wheels() {
         continue
       fi
       pip install 
pyarrow-${TEST_PYARROW_VERSION:-${VERSION}}-cp${pyver/.}-cp${python/.}-${platform}.whl
-      CHECK_WHEEL_CONTENT=${wheel_content:-"ON"} INSTALL_PYARROW=OFF 
ARROW_GCS=${check_gcs} \
+      ARROW_GCS=${check_gcs} \
+        ARROW_VERSION=${VERSION} \
+        CHECK_VERSION=${check_version} \
+        CHECK_WHEEL_CONTENT=${wheel_content:-"ON"} \
+        INSTALL_PYARROW=OFF \
         ${ARROW_DIR}/ci/scripts/python_wheel_unix_test.sh ${ARROW_SOURCE_DIR}
     done
   done
@@ -1086,6 +1096,12 @@ test_macos_wheels() {
     local wheel_content="OFF"
   fi
 
+  if [ "${SOURCE_KIND}" = "tarball" ]; then
+    local check_version="ON"
+  else
+    local check_version="OFF"
+  fi
+
   # verify arch-native wheels inside an arch-native conda environment
   for python in ${python_versions}; do
     local pyver=${python/m}
@@ -1102,8 +1118,13 @@ test_macos_wheels() {
       fi
 
       pip install pyarrow-${VERSION}-cp${pyver/.}-cp${python/.}-${platform}.whl
-      CHECK_WHEEL_CONTENT=${wheel_content:-"ON"} INSTALL_PYARROW=OFF 
ARROW_FLIGHT=${check_flight} \
-        ARROW_GCS=${check_gcs} ARROW_S3=${check_s3} \
+      ARROW_FLIGHT=${check_flight} \
+        ARROW_GCS=${check_gcs} \
+        ARROW_S3=${check_s3} \
+        ARROW_VERSION=${VERSION} \
+        CHECK_WHEEL_CONTENT=${wheel_content:-"ON"} \
+        CHECK_VERSION=${check_version} \
+        INSTALL_PYARROW=OFF \
         ${ARROW_DIR}/ci/scripts/python_wheel_unix_test.sh ${ARROW_SOURCE_DIR}
     done
   done

Reply via email to