Skip to content

Commit 4a71a5c

Browse files
committed
new: add .orig in tests, run mypy in test
1 parent b7e1b84 commit 4a71a5c

File tree

4 files changed

+86
-262
lines changed

4 files changed

+86
-262
lines changed

.github/workflows/maturin.yml

Lines changed: 83 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# This file is autogenerated by maturin v1.9.4
1+
# This file is autogenerated by maturin v1.9.5
22
# To update, run
33
#
4-
# maturin generate-ci github
4+
# maturin generate-ci github --pytest -m python/Cargo.toml -o .github/workflows/pytest.yml
5+
#
6+
# NOTE: this file has been modified to add mypy and force installing the packages from the dist directory
57
#
68
name: Maturin
79

@@ -45,14 +47,39 @@ jobs:
4547
uses: PyO3/maturin-action@v1
4648
with:
4749
target: ${{ matrix.platform.target }}
48-
args: --release --out dist --find-interpreter -m python/Cargo.toml
50+
args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml
4951
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
5052
manylinux: auto
5153
- name: Upload wheels
5254
uses: actions/upload-artifact@v4
5355
with:
5456
name: wheels-linux-${{ matrix.platform.target }}
5557
path: dist
58+
- name: pytest
59+
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
60+
shell: bash
61+
run: |
62+
set -e
63+
python3 -m venv .venv
64+
source .venv/bin/activate
65+
pip install pyfaup-rs --no-index --find-links dist --force-reinstall
66+
pip install pytest mypy
67+
cd python && pytest && mypy .
68+
- name: pytest
69+
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
70+
uses: uraimo/run-on-arch-action@v2
71+
with:
72+
arch: ${{ matrix.platform.target }}
73+
distro: ubuntu22.04
74+
githubToken: ${{ github.token }}
75+
install: |
76+
apt-get update
77+
apt-get install -y --no-install-recommends python3 python3-pip
78+
pip3 install -U pip pytest mypy
79+
run: |
80+
set -e
81+
pip3 install pyfaup-rs --no-index --find-links dist --force-reinstall
82+
cd python && pytest && mypy .
5683
5784
musllinux:
5885
runs-on: ${{ matrix.platform.runner }}
@@ -76,14 +103,44 @@ jobs:
76103
uses: PyO3/maturin-action@v1
77104
with:
78105
target: ${{ matrix.platform.target }}
79-
args: --release --out dist --find-interpreter -m python/Cargo.toml
106+
args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml
80107
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
81108
manylinux: musllinux_1_2
82109
- name: Upload wheels
83110
uses: actions/upload-artifact@v4
84111
with:
85112
name: wheels-musllinux-${{ matrix.platform.target }}
86113
path: dist
114+
- name: pytest
115+
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
116+
uses: addnab/docker-run-action@v3
117+
with:
118+
image: alpine:latest
119+
options: -v ${{ github.workspace }}:/io -w /io
120+
run: |
121+
set -e
122+
apk add py3-pip py3-virtualenv
123+
python3 -m virtualenv .venv
124+
source .venv/bin/activate
125+
pip install pyfaup-rs --no-index --find-links dist --force-reinstall
126+
pip install pytest mypy
127+
cd python && pytest && mypy .
128+
- name: pytest
129+
if: ${{ !startsWith(matrix.platform.target, 'x86') }}
130+
uses: uraimo/run-on-arch-action@v2
131+
with:
132+
arch: ${{ matrix.platform.target }}
133+
distro: alpine_latest
134+
githubToken: ${{ github.token }}
135+
install: |
136+
apk add py3-virtualenv
137+
run: |
138+
set -e
139+
python3 -m virtualenv .venv
140+
source .venv/bin/activate
141+
pip install pytest mypy
142+
pip install pyfaup-rs --no-index --find-links dist --force-reinstall
143+
cd python && pytest && mypy .
87144
88145
windows:
89146
runs-on: ${{ matrix.platform.runner }}
@@ -104,13 +161,24 @@ jobs:
104161
uses: PyO3/maturin-action@v1
105162
with:
106163
target: ${{ matrix.platform.target }}
107-
args: --release --out dist --find-interpreter -m python/Cargo.toml
164+
args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml
108165
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
166+
maturin-version: 1.9.4
109167
- name: Upload wheels
110168
uses: actions/upload-artifact@v4
111169
with:
112170
name: wheels-windows-${{ matrix.platform.target }}
113171
path: dist
172+
- name: pytest
173+
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
174+
shell: bash
175+
run: |
176+
set -e
177+
python3 -m venv .venv
178+
source .venv/Scripts/activate
179+
pip install pyfaup-rs --no-index --find-links dist --force-reinstall
180+
pip install pytest mypy
181+
cd python && pytest && mypy .
114182
115183
macos:
116184
runs-on: ${{ matrix.platform.runner }}
@@ -130,13 +198,21 @@ jobs:
130198
uses: PyO3/maturin-action@v1
131199
with:
132200
target: ${{ matrix.platform.target }}
133-
args: --release --out dist --find-interpreter -m python/Cargo.toml
201+
args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml
134202
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
135203
- name: Upload wheels
136204
uses: actions/upload-artifact@v4
137205
with:
138206
name: wheels-macos-${{ matrix.platform.target }}
139207
path: dist
208+
- name: pytest
209+
run: |
210+
set -e
211+
python3 -m venv .venv
212+
source .venv/bin/activate
213+
pip install pyfaup-rs --no-index --find-links dist --force-reinstall
214+
pip install pytest mypy
215+
cd python && pytest && mypy .
140216
141217
sdist:
142218
runs-on: ubuntu-latest
@@ -146,7 +222,7 @@ jobs:
146222
uses: PyO3/maturin-action@v1
147223
with:
148224
command: sdist
149-
args: --out dist -m python/Cargo.toml
225+
args: --out dist --manifest-path python/Cargo.toml
150226
- name: Upload sdist
151227
uses: actions/upload-artifact@v4
152228
with:

0 commit comments

Comments
 (0)