Skip to content

Build Wheels

Build Wheels #48

Workflow file for this run

name: Build Wheels
on:
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Windows 64 bit
- os: windows-latest
python: '39'
platform_id: win_amd64
- os: windows-latest
python: '310'
platform_id: win_amd64
- os: windows-latest
python: '311'
platform_id: win_amd64
- os: windows-latest
python: '312'
platform_id: win_amd64
# Linux
- os: ubuntu-latest
python: '39'
platform_id: manylinux_x86_64
manylinux_image: manylinux2014
- os: ubuntu-latest
python: '310'
platform_id: manylinux_x86_64
manylinux_image: manylinux2014
- os: ubuntu-latest
python: '311'
platform_id: manylinux_x86_64
manylinux_image: manylinux2014
- os: ubuntu-latest
python: '312'
platform_id: manylinux_x86_64
manylinux_image: manylinux2014
# MacOS arm64
- os: macos-latest
python: '39'
platform_id: macosx_arm64
- os: macos-latest
python: '310'
platform_id: macosx_arm64
- os: macos-latest
python: '311'
platform_id: macosx_arm64
- os: macos-latest
python: '312'
platform_id: macosx_arm64
steps:
- name: Check out pdc-dp-means
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
shell: bash
- name: Build wheels with cibuildwheel
uses: pypa/[email protected]
env:
CIBW_BEFORE_BUILD_LINUX: |
pip install -U cython
git clone https://github.com/scikit-learn/scikit-learn.git
cd scikit-learn
git checkout 1.2.X
python -m pip install -e .
cd ..
if [ ! -L sklearn ]; then
ln -s scikit-learn/sklearn .
fi
CIBW_BEFORE_BUILD_WINDOWS: >-
pip install -U cython &&
git clone https://github.com/scikit-learn/scikit-learn.git &&
cd scikit-learn &&
git checkout 1.2.X &&
python -m pip install -e . &&
cd .. &&
if not exist sklearn mklink /D sklearn scikit-learn\sklearn
CIBW_BEFORE_BUILD_MACOS: |
pip install -U cython
git clone https://github.com/scikit-learn/scikit-learn.git
cd scikit-learn
git checkout 1.2.X
python -m pip install -e .
cd ..
if [ ! -e sklearn ]; then
ln -s scikit-learn/sklearn .
fi
CIBW_TEST_REQUIRES: pytest numpy scikit-learn
CIBW_TEST_COMMAND: pytest {package}/tests
CIBW_ARCHS: auto
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
CIBW_TEST_SKIP: "*-macosx_arm64"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl
upload-to-pypi:
needs: build_wheels
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- name: Publish to PyPI
uses: pypa/[email protected]
with:
packages-dir: dist
skip-existing: true