Skip to content

Commit 288157e

Browse files
authored
Add python3.13, use uv for dev, bump dependencies (#17)
* Bump maturin to 1.9.0 * Use uv for dev/test/nox * Update python workflow to use uv * Update release workflow * Cargo update + bump pyo3 to 0.25.1 * Remove broken emscripten
1 parent ac1a766 commit 288157e

8 files changed

Lines changed: 442 additions & 194 deletions

File tree

.github/workflows/python.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,22 @@ jobs:
1717
strategy:
1818
matrix:
1919
os: [ubuntu-latest, macos-latest, windows-latest]
20-
python-version: [3.12]
21-
include:
22-
- os: ubuntu-latest
23-
python-version: "3.11"
24-
- os: ubuntu-latest
25-
python-version: "3.10"
26-
- os: ubuntu-latest
27-
python-version: 3.9
2820

2921
runs-on: "${{ matrix.os }}"
3022

3123
steps:
3224
- uses: actions/checkout@v4
3325

34-
- uses: actions/setup-python@v2
26+
- uses: astral-sh/setup-uv@v5
3527
with:
36-
python-version: ${{ matrix.python-version }}
28+
enable-cache: true
29+
cache-dependency-glob: "uv.lock"
3730

3831
- uses: dtolnay/rust-toolchain@master
3932
with:
4033
toolchain: stable
4134

4235
- uses: Swatinem/rust-cache@v2
4336

44-
- run: python3 -m pip install nox
45-
46-
- name: Run nox for ${{ matrix.python-version }}
47-
run: nox -s test-${{ matrix.python-version }}
37+
- name: Run nox
38+
run: uv run --only-group nox nox -p 3.13

.github/workflows/release.yml

Lines changed: 12 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ jobs:
3838
- uses: actions/checkout@v4
3939
- uses: actions/setup-python@v5
4040
with:
41-
python-version: '>=3.9'
41+
python-version: 3.x
4242
- name: Build wheels
4343
uses: PyO3/maturin-action@v1
4444
with:
4545
target: ${{ matrix.platform.target }}
4646
args: --release --out dist --find-interpreter
47-
sccache: 'true'
47+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
4848
manylinux: auto
4949
- name: Upload wheels
5050
uses: actions/upload-artifact@v4
@@ -69,13 +69,13 @@ jobs:
6969
- uses: actions/checkout@v4
7070
- uses: actions/setup-python@v5
7171
with:
72-
python-version: '>=3.9'
72+
python-version: 3.x
7373
- name: Build wheels
7474
uses: PyO3/maturin-action@v1
7575
with:
7676
target: ${{ matrix.platform.target }}
7777
args: --release --out dist --find-interpreter
78-
sccache: 'true'
78+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
7979
manylinux: musllinux_1_2
8080
- name: Upload wheels
8181
uses: actions/upload-artifact@v4
@@ -96,14 +96,14 @@ jobs:
9696
- uses: actions/checkout@v4
9797
- uses: actions/setup-python@v5
9898
with:
99-
python-version: '>=3.9'
99+
python-version: 3.x
100100
architecture: ${{ matrix.platform.target }}
101101
- name: Build wheels
102102
uses: PyO3/maturin-action@v1
103103
with:
104104
target: ${{ matrix.platform.target }}
105105
args: --release --out dist --find-interpreter
106-
sccache: 'true'
106+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
107107
- name: Upload wheels
108108
uses: actions/upload-artifact@v4
109109
with:
@@ -123,56 +123,19 @@ jobs:
123123
- uses: actions/checkout@v4
124124
- uses: actions/setup-python@v5
125125
with:
126-
python-version: '>=3.9'
126+
python-version: 3.x
127127
- name: Build wheels
128128
uses: PyO3/maturin-action@v1
129129
with:
130130
target: ${{ matrix.platform.target }}
131131
args: --release --out dist --find-interpreter
132-
sccache: 'true'
132+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
133133
- name: Upload wheels
134134
uses: actions/upload-artifact@v4
135135
with:
136136
name: wheels-macos-${{ matrix.platform.target }}
137137
path: dist
138138

139-
emscripten:
140-
runs-on: ${{ matrix.platform.runner }}
141-
strategy:
142-
matrix:
143-
platform:
144-
- runner: ubuntu-22.04
145-
target: wasm32-unknown-emscripten
146-
steps:
147-
- uses: actions/checkout@v4
148-
- run: pip install pyodide-build
149-
- name: Get Emscripten and Python version info
150-
shell: bash
151-
run: |
152-
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
153-
echo PYTHON_VERSION=$(pyodide config get python_version | cut -d '.' -f 1-2) >> $GITHUB_ENV
154-
pip uninstall -y pyodide-build
155-
- uses: mymindstorm/setup-emsdk@v12
156-
with:
157-
version: ${{ env.EMSCRIPTEN_VERSION }}
158-
actions-cache-folder: emsdk-cache
159-
- uses: actions/setup-python@v5
160-
with:
161-
python-version: ${{ env.PYTHON_VERSION }}
162-
- run: pip install pyodide-build
163-
- name: Build wheels
164-
uses: PyO3/maturin-action@v1
165-
with:
166-
target: ${{ matrix.platform.target }}
167-
args: --release --out dist -i ${{ env.PYTHON_VERSION }}
168-
sccache: 'true'
169-
rust-toolchain: nightly
170-
- name: Upload wheels
171-
uses: actions/upload-artifact@v4
172-
with:
173-
name: wasm-wheels
174-
path: dist
175-
176139
sdist:
177140
runs-on: ubuntu-latest
178141
steps:
@@ -191,11 +154,8 @@ jobs:
191154
release:
192155
name: Release
193156
runs-on: ubuntu-latest
194-
if: ${{ github.event_name == 'release' }}
195-
needs: [linux, musllinux, windows, macos, emscripten, sdist]
196-
environment:
197-
name: pypi
198-
url: https://pypi.org/p/vodozemac
157+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
158+
needs: [linux, musllinux, windows, macos, sdist]
199159
permissions:
200160
# Use to sign the release artifacts
201161
id-token: write
@@ -206,18 +166,12 @@ jobs:
206166
steps:
207167
- uses: actions/download-artifact@v4
208168
- name: Generate artifact attestation
209-
uses: actions/attest-build-provenance@v1
169+
uses: actions/attest-build-provenance@v2
210170
with:
211171
subject-path: 'wheels-*/*'
212172
- name: Publish to PyPI
213-
if: "startsWith(github.ref, 'refs/tags/')"
173+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
214174
uses: PyO3/maturin-action@v1
215175
with:
216176
command: upload
217177
args: --non-interactive --skip-existing wheels-*/*
218-
- name: Upload to GitHub Release
219-
uses: softprops/action-gh-release@v1
220-
with:
221-
files: |
222-
wasm-wheels/*.whl
223-
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}

0 commit comments

Comments
 (0)