Skip to content

Commit 306887f

Browse files
committed
Run stubtest for reclass_rs and mypy for the Python tests in CI
We extend the x86_64 Python workflow to run `stubtest` and `mypy` to get basic validation for the type stubs. This should be sufficient to catch PRs that introduce new Python API surface without adding type stubs. Unfortunately, from some limited testing, `stubtest` doesn't necessarily catch incorrect type stubs, since some of the PyO3 generated functions apparently have very limited metadata (especially for return types).
1 parent 8537706 commit 306887f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/python.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ jobs:
9494
python3 -m venv .venv
9595
source .venv/bin/activate
9696
pip install reclass-rs --find-links dist --force-reinstall
97-
pip install pytest kapicorp-reclass
97+
pip install pytest mypy kapicorp-reclass
98+
stubtest reclass_rs
99+
mypy --check-untyped-defs --ignore-missing-imports tests/
98100
pytest
99101
- name: pytest
100102
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}

0 commit comments

Comments
 (0)