Repository navigation
269 lines (234 loc) · 7.76 KB
/
Copy pathpython-auth.yml
File metadata and controls
269 lines (234 loc) · 7.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
name: Python eggpass-auth
on:
push:
branches: [main]
paths:
- "python/eggpass-auth/**"
- "crates/eggpass-auth/**"
- ".github/workflows/python-auth.yml"
- ".github/workflows/publish-eggpass-auth-pypi.yml"
pull_request:
branches: [main]
paths:
- "python/eggpass-auth/**"
- "crates/eggpass-auth/**"
- ".github/workflows/python-auth.yml"
- ".github/workflows/publish-eggpass-auth-pypi.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: python-auth-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
rust-and-local-tests:
name: Rust checks and local Python tests
runs-on: ubuntu-24.04
defaults:
run:
working-directory: python/eggpass-auth
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Create Python virtual environment
run: |
python -m venv .venv
echo "VIRTUAL_ENV=$PWD/.venv" >> "$GITHUB_ENV"
echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
- name: Install Rust
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup default stable
- name: Install Python build and test tools
run: python -m pip install "maturin==1.16.0" pytest mypy
- name: Check the vendored Rust source snapshot
run: python tools/sync_core.py --check
- name: Check Rust formatting, lint, and tests
run: |
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --all-targets --locked
- name: Build and install the local extension
run: maturin develop --release --locked
- name: Check stubs and run local-stub tests
run: |
mypy --strict tests/typecheck_api.py
pytest -q
build-wheels:
name: Build ${{ matrix.platform.name }} wheel
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- name: linux-x86_64
runner: ubuntu-24.04
manylinux: "2014"
interpreter: python3.11
- name: linux-aarch64
runner: ubuntu-24.04-arm
manylinux: "2014"
interpreter: python3.11
- name: macos-x86_64
runner: macos-15-intel
manylinux: "off"
interpreter: python
- name: macos-arm64
runner: macos-15
manylinux: "off"
interpreter: python
- name: windows-x86_64
runner: windows-2025
manylinux: "off"
interpreter: python
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Check the vendored Rust source snapshot
run: python tools/sync_core.py --check
working-directory: python/eggpass-auth
- name: Build stable-ABI wheel
uses: PyO3/maturin-action@v1
with:
maturin-version: v1.16.0
manylinux: ${{ matrix.platform.manylinux }}
args: >-
--release --locked --interpreter ${{ matrix.platform.interpreter }}
--out dist
working-directory: python/eggpass-auth
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.platform.name }}
path: python/eggpass-auth/dist/*.whl
if-no-files-found: error
retention-days: 14
test-wheels:
name: Test ${{ matrix.platform.name }} on Python ${{ matrix.python }}
needs: build-wheels
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- name: linux-x86_64
runner: ubuntu-24.04
- name: linux-aarch64
runner: ubuntu-24.04-arm
- name: macos-x86_64
runner: macos-15-intel
- name: macos-arm64
runner: macos-15
- name: windows-x86_64
runner: windows-2025
python: ["3.11", "3.12", "3.13", "3.14", "3.15"]
defaults:
run:
working-directory: python/eggpass-auth
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@v4
with:
name: wheel-${{ matrix.platform.name }}
path: python/eggpass-auth/dist
- name: Install wheel and test the installed package
shell: bash
run: |
python -m pip install --upgrade pip pytest mypy
python -m pip install --no-deps dist/*.whl
python -m pip check
python -c "import eggpass_auth; print(eggpass_auth.__all__)"
mypy --strict tests/typecheck_api.py
pytest -q
build-sdist:
name: Build and inspect source distribution
runs-on: ubuntu-24.04
defaults:
run:
working-directory: python/eggpass-auth
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install Rust
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup default stable
- name: Install Maturin and metadata checker
run: python -m pip install "maturin==1.16.0" twine
- name: Check the vendored Rust source snapshot
run: python tools/sync_core.py --check
- name: Build and validate source distribution metadata
run: |
maturin sdist --out dist
python -m twine check dist/*.tar.gz
python - <<'PY'
from pathlib import Path
import tarfile
archives = list(Path("dist").glob("*.tar.gz"))
assert len(archives) == 1, f"expected one sdist, found {archives}"
with tarfile.open(archives[0]) as archive:
members = archive.getnames()
required = (
"/README.md",
"/LICENSE",
"/Cargo.toml",
"/Cargo.lock",
"/src/lib.rs",
"/vendor/eggpass-auth/Cargo.toml",
"/vendor/eggpass-auth/src/lib.rs",
)
missing = [
suffix
for suffix in required
if not any(name.endswith(suffix) for name in members)
]
assert not missing, f"sdist is missing required files: {missing}"
PY
- uses: actions/upload-artifact@v4
with:
name: python-sdist
path: python/eggpass-auth/dist/*.tar.gz
if-no-files-found: error
retention-days: 14
test-sdist:
name: Build and test sdist on Python ${{ matrix.python }}
needs: build-sdist
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python: ["3.11", "3.12", "3.13", "3.14", "3.15"]
defaults:
run:
working-directory: python/eggpass-auth
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Install Rust
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup default stable
- uses: actions/download-artifact@v4
with:
name: python-sdist
path: python/eggpass-auth/dist
- name: Install source distribution and run package checks
run: |
python -m pip install --upgrade pip pytest mypy
python -m pip install --no-deps dist/*.tar.gz
python -m pip check
python -c "import eggpass_auth; print(eggpass_auth.__all__)"
mypy --strict tests/typecheck_api.py
pytest -q