This is an automated email from the ASF dual-hosted git repository.

alenka 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 21841161ae GH-48735: [CI][Python] Fix macOS wheel builds by forcing 
setuptools upgrade in venv (#48739)
21841161ae is described below

commit 21841161ae7a7fee71abad6b46717172b12cc33d
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Wed Jan 7 16:45:21 2026 +0900

    GH-48735: [CI][Python] Fix macOS wheel builds by forcing setuptools upgrade 
in venv (#48739)
    
    ### Rationale for this change
    
    Commit 866502e updated `pyproject.toml` to use the license format `license 
= "Apache-2.0"` and required `setuptools>=77` in `[build-system]`.
    
    However, macOS wheel builds for Python 3.10 were failing with:
    ```
    configuration error: `project.license` must be valid exactly by one 
definition (2 matches found)
    ```
    
    While Python 3.12 builds passed with identical code.
    
    When `python -m venv build-env` creates the virtual environment, Python 
3.10's venv inherits an older setuptools from the system Python installation. 
The build script uses `pip install --target` which seems not upgrading existing 
packages, leaving the old setuptools active for some reasons.
    
    Evidence from Python 3.10 logs:
    ```
    WARNING: Target directory 
.../build-env/lib/python3.10/site-packages/setuptools already exists. Specify 
--upgrade to force replacement.
    ```
    
    Python 3.12 had no such warnings and used the fresh setuptools-80.9.0.
    
    ### What changes are included in this PR?
    
    In `ci/scripts/python_wheel_macos_build.sh`, added `--upgrade 
--force-reinstall` flags to pip install command to force replacement of any old 
setuptools inherited from system Python
    
    In addition, also added `setuptools>=77` at 
`python/requirements-wheel-build.txt` to match with the original PR.
    
    ### Are these changes tested?
    
    Tested in CI: 
https://github.com/apache/arrow/pull/48739#issuecomment-3716765469
    
    ### Are there any user-facing changes?
    
    No, test/dev-only.
    
    * GitHub Issue: #48735
    
    Authored-by: Hyukjin Kwon <[email protected]>
    Signed-off-by: AlenkaF <[email protected]>
---
 ci/scripts/python_wheel_macos_build.sh | 2 ++
 python/requirements-wheel-build.txt    | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/ci/scripts/python_wheel_macos_build.sh 
b/ci/scripts/python_wheel_macos_build.sh
index 8d11331292..bd61154430 100755
--- a/ci/scripts/python_wheel_macos_build.sh
+++ b/ci/scripts/python_wheel_macos_build.sh
@@ -56,8 +56,10 @@ if [[ $FREE_THREADED_BUILD == "True"  ]]; then
 fi
 
 pip install \
+  --force-reinstall \
   --only-binary=:all: \
   --target $PIP_SITE_PACKAGES \
+  --upgrade \
   -r ${source_dir}/python/requirements-wheel-build.txt
 pip install "delocate>=0.10.3"
 
diff --git a/python/requirements-wheel-build.txt 
b/python/requirements-wheel-build.txt
index dfcda9ac18..ac6388762b 100644
--- a/python/requirements-wheel-build.txt
+++ b/python/requirements-wheel-build.txt
@@ -1,5 +1,5 @@
 cython>=3.1
 numpy>=2.0.0
 setuptools_scm
-setuptools>=58
+setuptools>=77
 wheel

Reply via email to