Skip to content

Commit fec5995

Browse files
committed
refactor: sync with scikit_build_example
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
1 parent 7a94877 commit fec5995

27 files changed

Lines changed: 684 additions & 543 deletions

.appveyor.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/cibw-cc.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CIBW cross-compile
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- master
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
14+
jobs:
15+
build:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- platform: android
21+
os: ubuntu-latest
22+
- platform: android
23+
os: macos-latest
24+
- platform: ios
25+
os: macos-latest
26+
archs: all
27+
- platform: pyodide
28+
os: ubuntu-latest
29+
30+
name: ${{ matrix.platform }} on ${{ matrix.os }}
31+
runs-on: ${{ matrix.os }}
32+
33+
steps:
34+
- uses: actions/checkout@v6
35+
36+
- uses: actions/setup-python@v6
37+
38+
- if: matrix.platform == 'ios'
39+
run: brew upgrade cmake
40+
41+
# GitHub Actions can't currently run the Android emulator on macOS.
42+
- name: Skip Android tests on macOS
43+
if: runner.os == 'macOS'
44+
run: echo "CIBW_TEST_COMMAND=" >> "$GITHUB_ENV"
45+
46+
# https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/
47+
- name: Enable KVM for Android emulator
48+
if: runner.os == 'Linux' && matrix.platform == 'android'
49+
run: |
50+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
51+
sudo udevadm control --reload-rules
52+
sudo udevadm trigger --name-match=kvm
53+
54+
- if: matrix.platform == 'android'
55+
run: pipx install patchelf
56+
57+
- uses: pypa/cibuildwheel@v3.4
58+
env:
59+
CIBW_PLATFORM: ${{ matrix.platform }}
60+
CIBW_ARCHS: ${{ matrix.archs || 'auto' }}
61+
62+
- uses: actions/upload-artifact@v7
63+
with:
64+
name: wheels-${{ matrix.platform }}-${{ matrix.os }}
65+
path: dist/*.whl

.github/workflows/conda.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
platform: [ubuntu-latest, windows-latest, macos-12]
16-
python-version: ["3.8", "3.10"]
15+
platform: [ubuntu-latest]
16+
python-version: ["3.10", "3.13"]
1717

1818
runs-on: ${{ matrix.platform }}
1919

@@ -23,26 +23,22 @@ jobs:
2323
shell: "bash -l {0}"
2424

2525
steps:
26-
- uses: actions/checkout@v4
27-
with:
28-
submodules: true
26+
- uses: actions/checkout@v6
2927

3028
- name: Get conda
31-
uses: conda-incubator/setup-miniconda@v3.0.4
29+
uses: conda-incubator/setup-miniconda@v3.3.0
3230
with:
3331
python-version: ${{ matrix.python-version }}
3432
channels: conda-forge
35-
channel-priority: strict
3633

37-
# Currently conda-build requires the dead package "toml" but doesn't declare it
3834
- name: Prepare
39-
run: conda install conda-build conda-verify pytest toml
35+
run: conda install conda-build conda-verify pytest
4036

4137
- name: Build
4238
run: conda build conda.recipe
4339

4440
- name: Install
45-
run: conda install -c ${CONDA_PREFIX}/conda-bld/ cmake_example
41+
run: conda install -c ${CONDA_PREFIX}/conda-bld/ scikit_build_example
4642

4743
- name: Test
48-
run: python -m pytest
44+
run: pytest tests

.github/workflows/format.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/pip.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pip
1+
name: "Pip"
22

33
on:
44
workflow_dispatch:
@@ -9,28 +9,24 @@ on:
99

1010
jobs:
1111
build:
12+
name: Build with Pip
13+
runs-on: ${{ matrix.platform }}
1214
strategy:
1315
fail-fast: false
1416
matrix:
15-
platform: [windows-latest, macos-13, ubuntu-latest]
16-
python-version: ["3.7", "3.11"]
17-
18-
runs-on: ${{ matrix.platform }}
17+
platform: [windows-latest, macos-latest, ubuntu-latest]
18+
python-version: ["3.9", "3.14", "pypy-3.10"]
1919

2020
steps:
21-
- uses: actions/checkout@v4
22-
with:
23-
submodules: true
21+
- uses: actions/checkout@v6
2422

25-
- uses: actions/setup-python@v5
23+
- uses: actions/setup-python@v6
2624
with:
2725
python-version: ${{ matrix.python-version }}
28-
29-
- name: Add requirements
30-
run: python -m pip install --upgrade wheel setuptools
26+
allow-prereleases: true
3127

3228
- name: Build and install
33-
run: pip install --verbose .[test]
29+
run: pip install --verbose . --group test
3430

3531
- name: Test
36-
run: python -m pytest
32+
run: pytest

.github/workflows/wheels.yml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@ on:
1010
types:
1111
- published
1212

13+
env:
14+
FORCE_COLOR: 3
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
1320
jobs:
1421
build_sdist:
1522
name: Build SDist
1623
runs-on: ubuntu-latest
1724
steps:
18-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v6
1926
with:
2027
submodules: true
2128

@@ -25,7 +32,7 @@ jobs:
2532
- name: Check metadata
2633
run: pipx run twine check dist/*
2734

28-
- uses: actions/upload-artifact@v4
35+
- uses: actions/upload-artifact@v7
2936
with:
3037
name: cibw-sdist
3138
path: dist/*.tar.gz
@@ -37,23 +44,22 @@ jobs:
3744
strategy:
3845
fail-fast: false
3946
matrix:
40-
os: [ubuntu-latest, windows-latest, macos-13]
47+
os: [ubuntu-latest, macos-15-intel, macos-latest, windows-latest, ubuntu-24.04-arm, windows-11-arm]
4148

4249
steps:
43-
- uses: actions/checkout@v4
50+
- uses: actions/checkout@v6
4451
with:
4552
submodules: true
4653

47-
- uses: pypa/cibuildwheel@v2.17
48-
env:
49-
CIBW_ARCHS_MACOS: auto universal2
54+
- uses: astral-sh/setup-uv@v8.0.0
55+
56+
- uses: pypa/cibuildwheel@v3.4
5057

5158
- name: Verify clean directory
5259
run: git diff --exit-code
5360
shell: bash
5461

55-
- name: Upload wheels
56-
uses: actions/upload-artifact@v4
62+
- uses: actions/upload-artifact@v7
5763
with:
5864
name: cibw-wheels-${{ matrix.os }}
5965
path: wheelhouse/*.whl
@@ -64,18 +70,25 @@ jobs:
6470
needs: [build_wheels, build_sdist]
6571
runs-on: ubuntu-latest
6672
if: github.event_name == 'release' && github.event.action == 'published'
73+
environment: pypi
74+
permissions:
75+
id-token: write
76+
attestations: write
6777

6878
steps:
69-
- uses: actions/setup-python@v5
79+
- uses: actions/setup-python@v6
7080
with:
7181
python-version: "3.x"
7282

73-
- uses: actions/download-artifact@v4
83+
- uses: actions/download-artifact@v8
7484
with:
7585
pattern: cibw-*
76-
path: dist
7786
merge-multiple: true
87+
path: dist
7888

79-
- uses: pypa/gh-action-pypi-publish@release/v1
89+
- name: Generate artifact attestation for sdist and wheels
90+
uses: actions/attest-build-provenance@v4
8091
with:
81-
password: ${{ secrets.pypi_password }}
92+
subject-path: "dist/*"
93+
94+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)