Skip to content

Consistently refer to "Blosc Development Team" without "The" #39

Consistently refer to "Blosc Development Team" without "The"

Consistently refer to "Blosc Development Team" without "The" #39

Workflow file for this run

name: Python wheels
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_REQUIRES: pytest psutil
CIBW_TEST_COMMAND: python -m pytest -m "not heavy" {project}/tests
CIBW_TEST_SKIP: "*macosx*arm64*"
# Building for musllinux and aarch64 takes way too much time.
# NumPy is adding musllinux for just x86_64 too, so this is not too bad.
CIBW_SKIP: "*musllinux*aarch64*"
jobs:
build_wheels:
# Only build wheels when tagging (typically a release)
if: startsWith(github.event.ref, 'refs/tags')
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }} - ${{ matrix.p_ver }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
env:
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_MACOS: "x86_64 arm64"
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [x86_64, aarch64]
cibw_build: ["cp3{9,10,11,12}-*"]
p_ver: ["3.9-3.12"]
exclude:
- os: windows-latest
arch: aarch64
# cibuild is already in charge to build aarch64 (see CIBW_ARCHS_MACOS)
- os: macos-latest
arch: aarch64
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel
- name: Set up QEMU
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v3
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
# Starting with C-Blosc2 2.11.3, we should not need to deactivate AVX512
#env:
# CIBW_CONFIG_SETTINGS: "--build-option=-DDEACTIVATE_AVX512:BOOL=YES"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
arch: [auto]
exclude:
- os: [ubuntu-latest]
# We don't support 32-bit platforms in python-blosc2
arch: x86
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-python@v5
name: Setup Python ${{ matrix.python-version }}
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-build.txt
- name: Build sdist
run: |
python -m build --sdist
- name: Upload sdist package
uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
- name: Build building extension from sdist package
run: |
cd ./dist
tar -xzf blosc2-*.tar.gz
cd ./blosc2-*/
# Starting with C-Blosc2 2.11.3, we should not need to deactivate AVX512
# python setup.py build_ext --inplace -DDEACTIVATE_AVX512:BOOL=YES
python setup.py build_ext --inplace
- name: Test sdist package with pytest
run: |
cd ./dist/blosc2-*/
python -m pip install -r requirements-tests.txt
python -m pip install -r requirements-runtime.txt
python -m pytest -m "not heavy"
upload_pypi:
needs: [ build_wheels, build_sdist ] # last but not least
runs-on: ubuntu-latest
# Only upload wheels when tagging (typically a release)
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.blosc_pypi_secret }}