Skip to content

Commit 6e3a7b0

Browse files
committed
Updating CI actions
1 parent 19757e3 commit 6e3a7b0

File tree

3 files changed

+32
-50
lines changed

3 files changed

+32
-50
lines changed

.github/workflows/cibuildwheels.yml

Lines changed: 28 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,39 @@ on:
1111
branches:
1212
- main
1313

14+
env:
15+
CIBW_BEFORE_BUILD: pip install -r requirements-build.txt
16+
CIBW_BUILD_VERBOSITY: 1
17+
CIBW_TEST_REQUIRES: pytest numpy<2 psutil msgpack
18+
CIBW_TEST_COMMAND: python -m pytest -m "not heavy" {project}/tests
19+
CIBW_TEST_SKIP: "*macosx*arm64*"
20+
# Building for musllinux and aarch64 takes way too much time.
21+
# NumPy is adding musllinux for just x86_64 too, so this is not too bad.
22+
CIBW_SKIP: "*musllinux*aarch64*"
1423

1524
jobs:
1625

1726
build_wheels:
18-
name: Build wheels on ${{ matrix.os }} (${{ matrix.arch }})
19-
runs-on: ${{ matrix.os }}
2027
# Only build wheels when tagging (typically a release)
2128
if: startsWith(github.event.ref, 'refs/tags')
29+
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }} - ${{ matrix.p_ver }}
30+
runs-on: ${{ matrix.os }}
31+
permissions:
32+
contents: write
33+
env:
34+
CIBW_BUILD: ${{ matrix.cibw_build }}
35+
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
36+
CIBW_ARCHS_MACOS: "x86_64 arm64"
2237
strategy:
2338
matrix:
2439
os: [ubuntu-latest, windows-latest, macos-latest]
2540
arch: [x86_64, aarch64]
41+
cibw_build: ["cp3{9,10,11,12}-*"]
42+
p_ver: ["3.9-3.12"]
2643
exclude:
2744
- os: windows-latest
2845
arch: aarch64
46+
# cibuild is already in charge to build aarch64 (see CIBW_ARCHS_MACOS)
2947
- os: macos-latest
3048
arch: aarch64
3149

@@ -35,15 +53,14 @@ jobs:
3553
with:
3654
submodules: 'recursive'
3755

38-
# - uses: conda-incubator/setup-miniconda@v2
39-
# with:
40-
# auto-update-conda: true
41-
# python-version: ${{ matrix.python-version }}
42-
4356
- name: Set up Python
4457
uses: actions/setup-python@v4
4558
with:
46-
python-version: '3.8'
59+
python-version: '3.9'
60+
61+
- name: Install cibuildwheel
62+
run: |
63+
python -m pip install cibuildwheel
4764
4865
- name: Set up QEMU
4966
if: ${{ matrix.arch == 'aarch64' }}
@@ -52,44 +69,9 @@ jobs:
5269
- name: Install Ninja
5370
uses: seanmiddleditch/gha-setup-ninja@master
5471

55-
- name: Install MSVC amd64
56-
uses: ilammy/msvc-dev-cmd@v1
57-
with:
58-
arch: amd64
59-
60-
- name: Install dependencies
61-
run: |
62-
python -m pip install --upgrade pip
63-
python -m pip install -r requirements-build.txt
64-
python -m pip install -r requirements-test-wheels.txt
65-
python -m pip install -r requirements-runtime.txt
66-
67-
- name: Build wheels (Windows)
68-
if: runner.os == 'Windows'
69-
run: |
70-
python -m pip install --upgrade pip
71-
python -m pip install cibuildwheel
72-
python -m cibuildwheel --output-dir wheelhouse
73-
env:
74-
CIBW_BUILD: 'cp38-win_amd64 cp39-win_amd64 cp310-win_amd64 cp311-win_amd64'
75-
CIBW_TEST_REQUIRES: pytest
76-
CIBW_TEST_COMMAND: python -m pytest -m "not heavy" {project}/tests
77-
CIBW_BUILD_VERBOSITY: 1
78-
79-
- name: Build wheels (Linux / Mac OSX)
80-
if: runner.os != 'Windows'
72+
- name: Build wheels
8173
run: |
82-
python -m pip install --upgrade pip
83-
python -m pip install cibuildwheel
8474
python -m cibuildwheel --output-dir wheelhouse
85-
env:
86-
CIBW_BUILD: 'cp38-* cp39-* cp310-* cp311-*'
87-
CIBW_SKIP: '*-manylinux*_i686 *-musllinux_* ${{ env.CIBW_SKIP}}'
88-
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
89-
CIBW_TEST_REQUIRES: pytest
90-
CIBW_TEST_COMMAND: python -m pytest -m "not heavy" {project}/tests
91-
CIBW_BUILD_VERBOSITY: 1
92-
CIBW_ARCHS_MACOS: "x86_64 arm64"
9375
9476
- name: Upload wheels
9577
uses: actions/upload-artifact@v3
@@ -123,8 +105,6 @@ jobs:
123105
run: |
124106
python -m pip install --upgrade pip
125107
python -m pip install -r requirements-build.txt
126-
python -m pip install -r requirements-tests.txt
127-
python -m pip install -r requirements-runtime.txt
128108
129109
- name: Build sdist
130110
run: |
@@ -145,6 +125,8 @@ jobs:
145125
- name: Test sdist package with pytest
146126
run: |
147127
cd ./dist/blosc2-*/
128+
python -m pip install -r requirements-tests.txt
129+
python -m pip install -r requirements-runtime.txt
148130
python -m pytest -m "not heavy"
149131
150132
upload_pypi:

requirements-build.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
setuptools
12
scikit-build
2-
cython<3
3+
cython
34
cmake
4-
numpy<2
5-
build
5+
oldest-supported-numpy
6+
ninja

requirements-tests.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
pip
21
numpy<2
32
pytest
43
psutil

0 commit comments

Comments
 (0)