Skip to content

2nd attempt at ruff #1104

2nd attempt at ruff

2nd attempt at ruff #1104

Workflow file for this run

name: wheels
on:
push:
branches: [master]
pull_request:
branches: ['*']
types:
# Opened, synchronize, and reopened are the default types
# We add ready_for_review to additionally trigger when converting from draft to non-draft
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
- opened
- synchronize
- reopened
- ready_for_review
release:
types:
- published
jobs:
make_sdist:
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.2.2
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v5.3.0
with:
python-version: 3.11
- name: Make sdist
run: |
python --version
pipx --version
pipx run build --sdist
- name: Install from sdist
run: |
pip install --upgrade pip setuptools wheel
cp dist/h3-*.tar.gz h3.tar.gz
pip install h3.tar.gz[test]
- name: Test sdist
run: pytest
- name: Upload artifacts to GitHub
uses: actions/upload-artifact@v4.4.3
with:
name: temp_result_sdist
path: ./dist
make_wheels:
name: 'cibw: ${{ matrix.name }}'
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-13
build: 'cp*-macosx_x86_64'
name: macOS13
- os: macos-14
build: 'cp*-macosx_arm64'
name: macOS14
- os: windows-latest
build: 'cp3*-win_amd64'
name: Windows 64-bit
- os: ubuntu-22.04
build: 'cp*-manylinux_x86_64'
name: Linux Intel glibc 64-bit
- os: ubuntu-22.04
build: 'cp38-musllinux_x86_64'
name: Linux Intel musl 64-bit 3.8
- os: ubuntu-22.04
build: 'cp39-musllinux_x86_64'
name: Linux Intel musl 64-bit 3.9
- os: ubuntu-22.04
build: 'cp310-musllinux_x86_64'
name: Linux Intel musl 64-bit 3.10
- os: ubuntu-22.04
build: 'cp311-musllinux_x86_64'
name: Linux Intel musl 64-bit 3.11
- os: ubuntu-22.04
build: 'cp312-musllinux_x86_64'
name: Linux Intel musl 64-bit 3.12
- os: ubuntu-22.04
build: 'cp313-musllinux_x86_64'
name: Linux Intel musl 64-bit 3.13
- os: ubuntu-22.04
build: 'cp38-manylinux_aarch64'
name: Linux Aarch64 3.8
- os: ubuntu-22.04
build: 'cp39-manylinux_aarch64'
name: Linux Aarch64 3.9
- os: ubuntu-22.04
build: 'cp310-manylinux_aarch64'
name: Linux Aarch64 3.10
- os: ubuntu-22.04
build: 'cp311-manylinux_aarch64'
name: Linux Aarch64 3.11
- os: ubuntu-22.04
build: 'cp312-manylinux_aarch64'
name: Linux Aarch64 3.12
- os: ubuntu-22.04
build: 'cp313-manylinux_aarch64'
name: Linux Aarch64 3.13
steps:
- uses: actions/checkout@v4.2.2
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1.13.0
if: runner.os == 'Windows'
- name: Set Windows variables
if: runner.os == 'Windows'
shell: bash
run: |
echo "CC=cl.exe" >> $GITHUB_ENV
echo "CXX=cl.exe" >> $GITHUB_ENV
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3.2.0
with:
platforms: aarch64
- uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_TEST_REQUIRES: pytest pytest-cov numpy
CIBW_TEST_COMMAND: pytest {project}/tests
CIBW_ARCHS_LINUX: auto aarch64
CIBW_BUILD: ${{ matrix.build }}
- name: Check with Twine
run: |
pipx run twine check wheelhouse/*
- name: Upload artifacts to GitHub
uses: actions/upload-artifact@v4.4.3
with:
name: temp_result_${{ matrix.os }}-${{ strategy.job-index }}
path: wheelhouse/*.whl
merge:
needs: [make_sdist, make_wheels]
runs-on: ubuntu-latest
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4.4.3
with:
name: wheels_and_sdist
pattern: temp_result_*
delete-merged: true
retention-days: 7
compression-level: 9
to_pypi:
needs: [merge]
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4.1.8
with:
name: wheels_and_sdist
path: dist
- uses: pypa/gh-action-pypi-publish@v1.10.3
with:
password: ${{ secrets.pypi_password }}