ENH: Add Windows-ARM64 builds #816
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build wheels | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| schedule: | |
| - cron: '0 0 * * 0,3' # 2/weekly | |
| jobs: | |
| build_wheels: | |
| name: ${{ matrix.os }}, ${{matrix.python_impl }} ${{ matrix.python }} | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel, windows-11-arm] | |
| python: [cp310, cp311, cp312, cp313, cp314] | |
| python_impl: [Python] | |
| include: | |
| - python: cp312 | |
| os: ubuntu-latest | |
| python_impl: Pyodide | |
| exclude: | |
| - os: windows-11-arm | |
| python: cp310 | |
| - os: windows-11-arm | |
| python: cp311 | |
| - os: windows-11-arm | |
| python: cp312 | |
| env: | |
| BUILD_COMMIT: "main" # or a specific version, e.g., v0.13.1 | |
| CIBW_BUILD: ${{ matrix.python }}-* | |
| CIBW_ARCHS_LINUX: "x86_64 aarch64" | |
| CIBW_ARCHS_MACOS: native | |
| # No support for pypy, musl, Win32 for 3.10+ | |
| # Skip musl for 3.8 and 3.9 since no upstream wheels | |
| CIBW_SKIP: "pp* *-win32 *musllinux_aarch64*" | |
| CIBW_TEST_REQUIRES: pytest pytest-xdist pytest-randomly threadpoolctl | |
| CIBW_TEST_COMMAND: python -c "import numpy; numpy.show_runtime(); import statsmodels; statsmodels.test(['-m','(not slow and not example)','-n','2'], exit=True)" | |
| # Avoid testing on emulated architectures and Pyodide | |
| CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x} *pyodide*" | |
| CIBW_REPAIR_WHEEL_COMMAND_LINUX: 'auditwheel repair --strip -w {dest_dir} {wheel}' | |
| CIBW_BUILD_VERBOSITY: 1 | |
| MULTIBUILD_WHEELS_STAGING_ACCESS: ${{ secrets.MULTIBUILD_WHEELS_STAGING_ACCESS }} | |
| SCIENTIFIC_PYTHON_NIGHTLY_WHEELS: ${{ secrets.SCIENTIFIC_PYTHON_NIGHTLY_WHEELS }} | |
| MKL_NUM_THREADS: 1 | |
| OMP_NUM_THREADS: 1 | |
| OPENLAS_NUM_THREADS: 1 | |
| IS_SCHEDULE: ${{ github.event_name == 'schedule' }} | |
| IS_PUSH: ${{ github.event_name == 'push' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Set up QEMU | |
| if: runner.os == 'Linux' | |
| uses: docker/setup-qemu-action@v4 | |
| with: | |
| platforms: all | |
| - name: Build wheels (Default) | |
| uses: pypa/cibuildwheel@v3.4 | |
| if: (matrix.python_impl != 'Pyodide') | |
| with: | |
| output-dir: wheelhouse | |
| package-dir: statsmodels | |
| env: | |
| CIBW_BEFORE_BUILD: 'git submodule foreach git checkout ${{ env.BUILD_COMMIT }}' | |
| - name: Build Pyodide wheel | |
| if: matrix.python_impl == 'Pyodide' | |
| uses: pypa/cibuildwheel@v3.4 | |
| with: | |
| output-dir: wheelhouse | |
| package-dir: statsmodels | |
| env: | |
| CIBW_BEFORE_BUILD: 'git submodule foreach git checkout ${{ env.BUILD_COMMIT }}' | |
| CIBW_PLATFORM: pyodide | |
| - name: Setup Upload Variables | |
| if: ${{ always() }} | |
| shell: bash | |
| run: | | |
| if [ "schedule" == "${{ github.event_name }}" ] || [ "push" == "${{ github.event_name }}" ]; then | |
| echo "Upload to Anaconda" | |
| echo "ANACONDA_UPLOAD=true" >> $GITHUB_ENV | |
| else | |
| echo "Do not upload to Anaconda" | |
| echo "ANACONDA_UPLOAD=false" >> $GITHUB_ENV | |
| fi | |
| if [ "schedule" == "${{ github.event_name }}" ] || [ "main" == "$BUILD_COMMIT" ]; then | |
| echo "Set upload for scientific-python-nightly-wheels" | |
| echo "ANACONDA_ORG=scientific-python-nightly-wheels" >> $GITHUB_ENV | |
| echo "TOKEN=$SCIENTIFIC_PYTHON_NIGHTLY_WHEELS" >> $GITHUB_ENV | |
| else | |
| echo "Set upload for multibuild-wheels-staging" | |
| echo "ANACONDA_ORG=multibuild-wheels-staging" >> $GITHUB_ENV | |
| echo "TOKEN=$MULTIBUILD_WHEELS_STAGING_ACCESS" >> $GITHUB_ENV | |
| fi | |
| - name: Install conda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| if: (runner.os != 'Windows') || ((runner.os == 'Windows') && (runner.arch != 'ARM64')) | |
| with: | |
| # for installation of anaconda-client, required for upload to | |
| # anaconda.org | |
| # default (and activated) environment name is test | |
| # Note that this step is *after* specific pythons have been used to | |
| # build and test the wheel | |
| auto-update-conda: true | |
| python-version: "3.12" | |
| miniforge-version: latest | |
| conda-remove-defaults: "true" | |
| - name: Inspect conda and install anaconda-client | |
| shell: pwsh | |
| if: (runner.os != 'Windows') || ((runner.os == 'Windows') && (runner.arch != 'ARM64')) | |
| run: | | |
| conda info | |
| conda list | |
| conda install -y anaconda-client | |
| - name: Install anaconda-client (Windows ARM64) | |
| shell: pwsh | |
| if: ((runner.os == 'Windows') && (runner.arch == 'ARM64')) | |
| run: | | |
| python -m pip install pip -U | |
| pip install --only-binary :all: anaconda-client | |
| - name: Upload wheels | |
| if: ${{ always() }} | |
| shell: pwsh | |
| run: | | |
| # trigger an upload to the shared ecosystem | |
| # infrastructure at: https://anaconda.org/scientific-python-nightly-wheels | |
| # for cron jobs only (restricted to main branch once | |
| # per week) | |
| # SCIENTIFIC_PYTHON_NIGHTLY_WHEELS is a secret token | |
| # used in Travis CI config, originally | |
| # | |
| # for merges (push events) we use the staging area instead; | |
| # MULTIBUILD_WHEELS_STAGING_ACCESS is a secret token used in Travis | |
| # CI config, originally generated at anaconda.org for | |
| # multibuild-wheels-staging | |
| # generated at anaconda.org for scientific-python-nightly-wheels | |
| echo ${PWD} | |
| if ( $env:ANACONDA_UPLOAD -eq "true") | |
| { | |
| echo "Uploading to $env:ANACONDA_ORG" | |
| # main branches of these two packages | |
| ls ./wheelhouse/*.whl | |
| anaconda --verbose -t $env:TOKEN upload --force -u $env:ANACONDA_ORG ./wheelhouse/*.whl | |
| echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple" | |
| } |