Repository navigation
51 lines (43 loc) · 1.77 KB
/
Copy pathpython.yml
File metadata and controls
51 lines (43 loc) · 1.77 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
name: python
on:
push:
branches: [main]
pull_request:
# Least privilege: the workflow only reads the repository.
permissions:
contents: read
# ubuntu-24.04 is what ubuntu-latest names today (actions/runner-images README, read
# 2026-10-03).
jobs:
build:
name: python (build, smoke, guides)
runs-on: ubuntu-24.04
defaults:
run:
working-directory: bindings/python
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
# zero-server-native is the PyO3 crate under packages/native; every other package
# is pure Python, installed from its directory so the namespace portions merge.
- name: Set up venv, build the engine, and install every package
run: |
python -m venv .venv
. .venv/bin/activate
pip install maturin pytest
maturin develop -m packages/native/Cargo.toml
pip install $(find packages -mindepth 1 -maxdepth 1 -type d ! -name native)
# The generator is a development tool behind the `stubs` feature, so the
# published wheel never carries pyo3-stub-gen.
- name: Regenerate the type stub
run: cargo run --bin stub_gen --features stubs --manifest-path packages/native/Cargo.toml
- name: Check the generated stub is in sync with the Rust source
run: |
if ! git diff --exit-code -- packages/native/python/zero_server/_native/__init__.pyi; then
echo "::error::Generated stub is stale. Run 'cargo run --bin stub_gen --features stubs' in bindings/python/packages/native and commit python/zero_server/_native/__init__.pyi."
exit 1
fi
- name: Smoke, conformance, guide, and doctest suites
run: .venv/bin/python -m pytest