Skip to content

Apache DataFusion SQL Query Engine

ARROW-10539: [Packaging][Python] Use GitHub Actions to build wheels for Windows

Sutou Kouhei2462a8932082
diff --git a/dev/tasks/python-wheels/appveyor.yml b/dev/tasks/python-wheels/appveyor.yml
deleted file mode 100644
index 44371af945..0000000000
--- a/dev/tasks/python-wheels/appveyor.yml
+++ /dev/null
@@ -1,80 +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.
-
-os: Visual Studio 2015
-
-# Do not build on Git tags
-skip_tags: true
-
-environment:
- ARCH: "64"
- GENERATOR: Visual Studio 14 2015 Win64
- PYTHON_VERSION: "{{ python_version }}"
- PYTHON_INTERPRETER: {{ python_interpreter }}
- ARROW_SRC: C:\apache-arrow
- PYARROW_VERSION: {{ arrow.no_rc_version }}
-
-init:
- - set MINICONDA=C:\Miniconda3-x64
- - set PATH=%MINICONDA%;%MINICONDA%/Scripts;%MINICONDA%/Library/bin;%PATH%
-
-build_script:
- - mkdir wheels
- - git config core.symlinks true
-
- - git clone --no-checkout {{ arrow.remote }} %ARROW_SRC% || exit /B
- - git -C %ARROW_SRC% fetch -t {{ arrow.remote }} {{ arrow.branch }} || exit /B
- - git -C %ARROW_SRC% checkout FETCH_HEAD || exit /B
- - git -C %ARROW_SRC% submodule update --init || exit /B
-
- # Avoid picking up AppVeyor-installed OpenSSL (linker errors with gRPC)
- # XXX Perhaps there is a smarter way of solving this issue?
- - rd /s /q C:\OpenSSL-Win32
- - rd /s /q C:\OpenSSL-Win64
- - rd /s /q C:\OpenSSL-v11-Win32
- - rd /s /q C:\OpenSSL-v11-Win64
- - rd /s /q C:\OpenSSL-v111-Win32
- - rd /s /q C:\OpenSSL-v111-Win64
-
- # Disable vcpkg to prevent unrelated noisy link warnings
- - vcpkg integrate remove
-
- - call %ARROW_SRC%\dev\tasks\python-wheels\{{ script }}
-
-after_build:
- # the artifacts must be uploaded from a directory relative to the build root
- - xcopy %ARROW_SRC%\python\dist\* wheels\
-{% if arrow.branch == 'master' %}
- # upload to gemfury
- - conda install -y curl
- - for /f %%i in ('dir /b wheels\*.whl') do set WHEEL_PATH=wheels\%%i
- - curl.exe -F "package=@%WHEEL_PATH%" "https://%CROSSBOW_GEMFURY_TOKEN%@push.fury.io/%CROSSBOW_GEMFURY_ORG%/"
-{% endif %}
-
-#on_finish:
- #- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
-
-artifacts:
- - path: 'wheels\*.whl'
-
-deploy:
- release: {{ task.tag }}
- provider: GitHub
- auth_token: "%CROSSBOW_GITHUB_TOKEN%"
- artifact: /.*\.whl/
- draft: false
- prerelease: false
diff --git a/dev/tasks/python-wheels/github.win.yml b/dev/tasks/python-wheels/github.win.yml
new file mode 100644
index 0000000000..f7638d8be3
--- /dev/null
+++ b/dev/tasks/python-wheels/github.win.yml
@@ -0,0 +1,100 @@
+# 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.
+
+# NOTE: must set "Crossbow" as name to have the badge links working in the
+# github comment reports!
+name: Crossbow
+
+on:
+ push:
+ branches:
+ - "*-github-*"
+
+jobs:
+ build:
+ name: "Build wheel for Windows"
+ runs-on: windows-2016
+ env:
+ ARCH: "x64"
+ GENERATOR: Visual Studio 15 2017
+ PYTHON_VERSION: "{{ python_version }}"
+ PYARROW_VERSION: {{ arrow.no_rc_version }}
+ steps:
+ - name: Checkout Arrow
+ shell: bash
+ run: |
+ git clone --no-checkout {{ arrow.remote }} arrow
+ git -C arrow config core.symlinks true
+ git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }}
+ git -C arrow checkout FETCH_HEAD
+ git -C arrow submodule update --init --recursive
+ - name: Fetch Submodules and Tags
+ shell: bash
+ run: cd arrow && ci/scripts/util_checkout.sh
+ - uses: actions/setup-python@v2
+ with:
+ python-version: "{{ python_version }}"
+ - name: Set up Miniconda
+ shell: bash
+ run: |
+ echo "c:\\Miniconda\\condabin" >> $GITHUB_PATH
+ - name: Build wheel
+ shell: bash
+ run: |
+ arrow/dev/tasks/python-wheels/win-build.bat
+ - name: Prepare artifacts
+ # the artifacts must be uploaded from a directory relative to the build root
+ shell: bash
+ run: |
+ mv arrow/python/dist/ wheels/
+ {% if arrow.branch == 'master' %}
+ - name: Upload to gemfury
+ shell: bash
+ run: |
+ conda.bat install -y curl
+ WHEEL_PATH=$(echo wheels/*.whl)
+ curl.exe \
+ -F "package=@${WHEEL_PATH}" \
+ "https://${CROSSBOW_GEMFURY_TOKEN}@push.fury.io/${CROSSBOW_GEMFURY_ORG}/"
+ env:
+ CROSSBOW_GEMFURY_ORG: {{ '${{ secrets.CROSSBOW_GEMFURY_ORG }}' }}
+ CROSSBOW_GEMFURY_TOKEN: {{ '${{ secrets.CROSSBOW_GEMFURY_TOKEN }}' }}
+ {% endif %}
+ - name: Set up Crossbow
+ shell: bash
+ run: |
+ pip install \
+ click \
+ github3.py \
+ jinja2 \
+ jira \
+ pygit2 \
+ ruamel.yaml \
+ setuptools_scm \
+ toolz
+ - name: Upload artifacts
+ shell: bash
+ run: |
+ python arrow/dev/tasks/crossbow.py \
+ --queue-path . \
+ --queue-remote {{ queue_remote_url }} \
+ upload-artifacts \
+ --pattern "wheels/*.whl" \
+ --sha {{ task.branch }} \
+ --tag {{ task.tag }}
+ env:
+ CROSSBOW_GITHUB_TOKEN: {{ '${{ secrets.CROSSBOW_GITHUB_TOKEN }}' }}
diff --git a/dev/tasks/python-wheels/win-build.bat b/dev/tasks/python-wheels/win-build.bat
index 449834a836..9d02e787f0 100644
--- a/dev/tasks/python-wheels/win-build.bat
+++ b/dev/tasks/python-wheels/win-build.bat
@@ -20,34 +20,32 @@
@rem Building Gandiva in the wheels is disabled for now to make the wheels
@rem smaller.
-@rem --file=%ARROW_SRC%\ci\conda_env_gandiva.yml ^
+@rem --file=arrow\ci\conda_env_gandiva.yml ^
@rem create conda environment for compiling
-call conda create -n wheel-build -q -y -c conda-forge ^
- --file=%ARROW_SRC%\ci\conda_env_cpp.yml ^
+call conda.bat create -n wheel-build -q -y -c conda-forge ^
+ --file=arrow\ci\conda_env_cpp.yml ^
+ --file=arrow\ci\conda_env_python.yml ^
"vs2015_runtime<14.16" ^
python=%PYTHON_VERSION% || exit /B
call conda.bat activate wheel-build
-@rem Cannot use conda_env_python.yml here because conda-forge has
-@rem ceased providing up-to-date packages for Python 3.5
-pip install -r %ARROW_SRC%\python\requirements-wheel-build.txt
-
set ARROW_HOME=%CONDA_PREFIX%\Library
set PARQUET_HOME=%CONDA_PREFIX%\Library
echo %ARROW_HOME%
@rem Build Arrow C++ libraries
-mkdir %ARROW_SRC%\cpp\build
-pushd %ARROW_SRC%\cpp\build
+mkdir arrow\cpp\build
+pushd arrow\cpp\build
@rem ARROW-6938(wesm): bz2 is disabled on Windows because the build
@rem currently selects the shared lib for linking. Using the zstd lib from
@rem conda-forge also results in a broken build so we use the BUNDLED
@rem dependency resolution strategy for now
-cmake -G "%GENERATOR%" ^
+cmake -A "%ARCH%" ^
+ -G "%GENERATOR%" ^
-DCMAKE_INSTALL_PREFIX=%ARROW_HOME% ^
-DARROW_BOOST_USE_SHARED=OFF ^
-DARROW_BUILD_STATIC=OFF ^
@@ -75,41 +73,47 @@ cmake -G "%GENERATOR%" ^
-Dzstd_SOURCE=BUNDLED ^
-Dutf8proc_SOURCE=BUNDLED ^
.. || exit /B
-cmake --build . --target install --config Release || exit /B
+cmake ^
+ --build . ^
+ --config Release ^
+ --parallel %NUMBER_OF_PROCESSORS% ^
+ --target install || exit /B
popd
set PYARROW_BUILD_TYPE=Release
-set PYARROW_PARALLEL=8
+set PYARROW_BUNDLE_ARROW_CPP=1
+set PYARROW_CMAKE_GENERATOR=%GENERATOR%
+set PYARROW_CMAKE_OPTIONS=-A %ARCH%
set PYARROW_INSTALL_TESTS=1
+set PYARROW_PARALLEL=%NUMBER_OF_PROCESSORS%
set PYARROW_WITH_DATASET=1
set PYARROW_WITH_FLIGHT=1
set PYARROW_WITH_GANDIVA=0
set PYARROW_WITH_PARQUET=1
set PYARROW_WITH_STATIC_BOOST=1
-set PYARROW_BUNDLE_ARROW_CPP=1
set SETUPTOOLS_SCM_PRETEND_VERSION=%PYARROW_VERSION%
-pushd %ARROW_SRC%\python
+pushd arrow\python
python setup.py bdist_wheel || exit /B
popd
call conda.bat deactivate
-set ARROW_TEST_DATA=%ARROW_SRC%\testing\data
+set ARROW_TEST_DATA=arrow\testing\data
@rem install the test dependencies
-%PYTHON_INTERPRETER% -m pip install -r %ARROW_SRC%\python\requirements-wheel-test.txt || exit /B
+python -m pip install -r arrow\python\requirements-wheel-test.txt || exit /B
@rem install the produced wheel in a non-conda environment
-%PYTHON_INTERPRETER% -m pip install --no-index --find-links=%ARROW_SRC%\python\dist\ pyarrow || exit /B
+python -m pip install --no-index --find-links=arrow\python\dist\ pyarrow || exit /B
@rem test the imports
-%PYTHON_INTERPRETER% -c "import pyarrow" || exit /B
-%PYTHON_INTERPRETER% -c "import pyarrow.parquet" || exit /B
-%PYTHON_INTERPRETER% -c "import pyarrow.flight" || exit /B
-%PYTHON_INTERPRETER% -c "import pyarrow.dataset" || exit /B
+python -c "import pyarrow" || exit /B
+python -c "import pyarrow.parquet" || exit /B
+python -c "import pyarrow.flight" || exit /B
+python -c "import pyarrow.dataset" || exit /B
@rem run the python tests, but disable the cython because there is a linking
@rem issue on python 3.8
set PYARROW_TEST_CYTHON=OFF
-%PYTHON_INTERPRETER% -m pytest -rs --pyargs pyarrow || exit /B
+python -m pytest -rs --pyargs pyarrow || exit /B
diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml
index 9acf6b239d..a2349f5b5a 100644
--- a/dev/tasks/tasks.yml
+++ b/dev/tasks/tasks.yml
@@ -546,43 +546,27 @@ tasks:
############################## Wheel Windows ################################
- wheel-win-cp35m:
- ci: appveyor
- template: python-wheels/appveyor.yml
- params:
- script: win-build.bat
- python_version: 3.5
- python_interpreter: C:\Python35-x64\python.exe
- artifacts:
- - pyarrow-{no_rc_version}-cp35-cp35m-win_amd64.whl
-
wheel-win-cp36m:
- ci: appveyor
- template: python-wheels/appveyor.yml
+ ci: github
+ template: python-wheels/github.win.yml
params:
- script: win-build.bat
python_version: 3.6
- python_interpreter: C:\Python36-x64\python.exe
artifacts:
- pyarrow-{no_rc_version}-cp36-cp36m-win_amd64.whl
wheel-win-cp37m:
- ci: appveyor
- template: python-wheels/appveyor.yml
+ ci: github
+ template: python-wheels/github.win.yml
params:
- script: win-build.bat
python_version: 3.7
- python_interpreter: C:\Python37-x64\python.exe
artifacts:
- pyarrow-{no_rc_version}-cp37-cp37m-win_amd64.whl
wheel-win-cp38:
- ci: appveyor
- template: python-wheels/appveyor.yml
+ ci: github
+ template: python-wheels/github.win.yml
params:
- script: win-build.bat
python_version: 3.8
- python_interpreter: C:\Python38-x64\python.exe
artifacts:
- pyarrow-{no_rc_version}-cp38-cp38-win_amd64.whl