-
-
Notifications
You must be signed in to change notification settings - Fork 37
136 lines (118 loc) · 4.07 KB
/
cibuildwheels.yml
File metadata and controls
136 lines (118 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Python wheels
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
tags:
- '*'
pull_request:
branches:
- main
env:
CIBW_BUILD_VERBOSITY: 1
# Skip testing on aarch64 for now, as it is emulated on GitHub Actions and takes too long
# Now that github provides native arm64 runners, we can enable tests again
# CIBW_TEST_SKIP: "*linux*aarch64*"
# Skip PyPy wheels for now (numexpr needs some adjustments first)
# musllinux takes too long to build, and it's not worth it for now
CIBW_SKIP: "pp* *musllinux* *-win32"
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }}
runs-on: ${{ matrix.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:
fail-fast: false
matrix:
include:
# Linux x86_64 builds
- os: ubuntu-latest
arch: x86_64
cibw_pattern: "cp3{11,12,13}-manylinux*"
artifact_name: "linux-x86_64"
# Linux ARM64 builds (native runners)
- os: ubuntu-24.04-arm
arch: aarch64
cibw_pattern: "cp3{11,12,13}-manylinux*"
artifact_name: "linux-aarch64"
# Don't use native runners for now (looks like wait times are too long)
#runs-on: ["ubuntu-latest", "arm64"]
# Windows builds
- os: windows-latest
arch: x86_64
cibw_pattern: "cp3{11,12,13}-win64"
artifact_name: "windows-x86_64"
# macOS builds (universal2)
- os: macos-latest
arch: x86_64
cibw_pattern: "cp3{11,12,13}-macosx*"
artifact_name: "macos-universal2"
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
# Use the most recent released python
python-version: '3.x'
# For some reason, this is still needed, even when using new arm64 runners
# - name: Set up QEMU
# if: ${{ matrix.arch == 'aarch64' }}
# uses: docker/setup-qemu-action@v3
- name: Install Ninja
id: ninja
uses: turtlesec-no/get-ninja@main
- name: Install MSVC amd64
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: Build wheels
uses: pypa/cibuildwheel@v2.23
- name: Make sdist
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
python -m pip install build
python -m build --sdist --outdir wheelhouse .
- name: Build building extension from sdist package
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
cd ./wheelhouse
tar -xzf blosc2-*.tar.gz
cd ./blosc2-*/
python -m venv sdist_test_env
source sdist_test_env/bin/activate
pip install pip --upgrade
pip install --break-system-packages -e .[test]
- name: Test sdist package with pytest
if: ${{ matrix.os == 'ubuntu-latest' }}
timeout-minutes: 10
run: |
cd ./wheelhouse/blosc2-*/
source sdist_test_env/bin/activate
python -m pytest tests/test_open.py tests/test_vlmeta.py tests/ndarray/test_evaluate.py
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: |
./wheelhouse/*.whl
./wheelhouse/*.tar.gz
upload_pypi:
needs: [ build_wheels]
runs-on: ubuntu-latest
# Only upload wheels when tagging (typically a release)
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/download-artifact@v4
with:
path: ./wheelhouse
merge-multiple: true # Merge all the wheels artifacts into one directory
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.blosc_pypi_secret }}
packages-dir: wheelhouse/