Skip to content

Commit f74e64e

Browse files
Merge pull request #373 from Blosc/new-wheels-actions
Updated config file for github
2 parents 5a54cc1 + c217116 commit f74e64e

File tree

1 file changed

+53
-59
lines changed

1 file changed

+53
-59
lines changed

.github/workflows/cibuildwheels.yml

Lines changed: 53 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,50 @@ env:
1414
# Skip testing on aarch64 for now, as it is emulated on GitHub Actions and takes too long
1515
# Now that github provides native arm64 runners, we can enable tests again
1616
# CIBW_TEST_SKIP: "*linux*aarch64*"
17+
# Skip PyPy wheels for now (numexpr needs some adjustments first)
18+
# musllinux takes too long to build, and it's not worth it for now
19+
CIBW_SKIP: "pp* *musllinux* *-win32"
1720

1821
jobs:
1922

2023
build_wheels:
21-
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }} - ${{ matrix.p_ver }}
22-
runs-on: ${{ matrix.os }}
24+
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }}
25+
runs-on: ${{ matrix.runs-on || matrix.os }}
2326
permissions:
2427
contents: write
2528
env:
2629
CIBW_BUILD: ${{ matrix.cibw_build }}
2730
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
2831
CIBW_ARCHS_MACOS: "x86_64 arm64"
2932
strategy:
33+
fail-fast: false
3034
matrix:
31-
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]
32-
arch: [x86_64, aarch64]
33-
# aarch64 is emulated, and it is giving issues with cibuildwheel
34-
# Just build for x86_64 for now (Mac arm64 is already covered by cibuildwheel)
35-
# arch: [x86_64]
36-
cibw_build: ["cp3{11,12,13}-*"]
37-
p_ver: ["3.11-3.13"]
38-
exclude:
39-
- os: windows-latest
40-
arch: aarch64
41-
# cibuild is already in charge to build aarch64 (see CIBW_ARCHS_MACOS)
42-
- os: macos-latest
43-
arch: aarch64
44-
# Mutually exclude aarch64 and x86_64 for ubuntu-24.04-arm and ubuntu-latest
45-
- os: ubuntu-24.04-arm
46-
arch: x86_64
35+
include:
36+
# Linux x86_64 builds
4737
- os: ubuntu-latest
38+
arch: x86_64
39+
cibw_pattern: "cp3{11,12,13}-manylinux*"
40+
artifact_name: "linux-x86_64"
41+
42+
# Linux ARM64 builds (native runners)
43+
- os: ubuntu-24.04-arm
4844
arch: aarch64
45+
cibw_pattern: "cp3{11,12,13}-manylinux*"
46+
artifact_name: "linux-aarch64"
47+
# Don't use native runners for now (looks like wait times are too long)
48+
#runs-on: ["ubuntu-latest", "arm64"]
49+
50+
# Windows builds
51+
- os: windows-latest
52+
arch: x86_64
53+
cibw_pattern: "cp3{11,12,13}-win64"
54+
artifact_name: "windows-x86_64"
4955

56+
# macOS builds (universal2)
57+
- os: macos-latest
58+
arch: x86_64
59+
cibw_pattern: "cp3{11,12,13}-macosx*"
60+
artifact_name: "macos-universal2"
5061
steps:
5162
- name: Checkout repo
5263
uses: actions/checkout@v4
@@ -58,9 +69,9 @@ jobs:
5869
python-version: '3.x'
5970

6071
# For some reason, this is still needed, even when using new arm64 runners
61-
- name: Set up QEMU
62-
if: ${{ matrix.arch == 'aarch64' }}
63-
uses: docker/setup-qemu-action@v3
72+
# - name: Set up QEMU
73+
# if: ${{ matrix.arch == 'aarch64' }}
74+
# uses: docker/setup-qemu-action@v3
6475

6576
- name: Install Ninja
6677
id: ninja
@@ -74,64 +85,47 @@ jobs:
7485
- name: Build wheels
7586
uses: pypa/[email protected]
7687

77-
- name: Upload wheels
78-
uses: actions/upload-artifact@v4
79-
with:
80-
name: wheels-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.p_ver }}
81-
path: ./wheelhouse/*.whl
82-
83-
build_sdist:
84-
name: Build sdist
85-
runs-on: ubuntu-latest
86-
strategy:
87-
matrix:
88-
python-version: [3.12]
89-
os: [ubuntu-latest]
90-
arch: [auto]
91-
exclude:
92-
- os: [ubuntu-latest]
93-
# We don't support 32-bit platforms in python-blosc2
94-
arch: x86
95-
96-
steps:
97-
- uses: actions/checkout@v4
98-
99-
- uses: actions/setup-python@v5
100-
name: Setup Python ${{ matrix.python-version }}
101-
with:
102-
python-version: ${{ matrix.python-version }}
103-
104-
- name: Build sdist
105-
run: pipx run build --sdist --outdir ./wheelhouse
106-
107-
- name: Upload sdist package
108-
uses: actions/upload-artifact@v4
109-
with:
110-
name: wheels-source
111-
path: wheelhouse/*.tar.gz
88+
- name: Make sdist
89+
if: ${{ matrix.os == 'ubuntu-latest' }}
90+
run: |
91+
python -m pip install build
92+
python -m build --sdist --outdir wheelhouse .
11293
11394
- name: Build building extension from sdist package
95+
if: ${{ matrix.os == 'ubuntu-latest' }}
11496
run: |
11597
cd ./wheelhouse
11698
tar -xzf blosc2-*.tar.gz
11799
cd ./blosc2-*/
100+
python -m venv sdist_test_env
101+
source sdist_test_env/bin/activate
118102
pip install pip --upgrade
119103
pip install --break-system-packages -e .[test]
120104
121105
- name: Test sdist package with pytest
106+
if: ${{ matrix.os == 'ubuntu-latest' }}
107+
timeout-minutes: 10
122108
run: |
123109
cd ./wheelhouse/blosc2-*/
124-
pytest
110+
source sdist_test_env/bin/activate
111+
python -m pytest tests/test_open.py tests/test_vlmeta.py tests/ndarray/test_evaluate.py
112+
113+
- uses: actions/upload-artifact@v4
114+
with:
115+
name: ${{ matrix.artifact_name }}
116+
path: |
117+
./wheelhouse/*.whl
118+
./wheelhouse/*.tar.gz
119+
125120
126121
upload_pypi:
127-
needs: [ build_wheels, build_sdist ] # last but not least
122+
needs: [ build_wheels]
128123
runs-on: ubuntu-latest
129124
# Only upload wheels when tagging (typically a release)
130125
if: startsWith(github.event.ref, 'refs/tags')
131126
steps:
132127
- uses: actions/download-artifact@v4
133128
with:
134-
name: wheels-*
135129
path: ./wheelhouse
136130
merge-multiple: true # Merge all the wheels artifacts into one directory
137131

0 commit comments

Comments
 (0)