Clean up nanobind typing and source layout

This commit is contained in:
2026-03-27 11:19:53 +08:00
parent 9d63177de0
commit 69e83d8430
19 changed files with 792 additions and 47 deletions
+21 -1
View File
@@ -20,7 +20,7 @@ The current fork keeps the triangulation core, exposes it through `nanobind`, an
Current package status:
- Python `>=3.10`
- NumPy runtime dependency
- Runtime dependencies: NumPy, jaxtyping
- Current version: `0.2.0`
## Current Capabilities
@@ -54,6 +54,12 @@ Run the test suite:
uv run pytest -q
```
Run static typing checks against the Python package:
```bash
uv run basedpyright
```
Build source and wheel artifacts:
```bash
@@ -62,6 +68,20 @@ uv build
`run_container.sh` is still present in the repo, but it is a leftover helper script rather than the primary or best-supported development workflow.
## Typing Workflow
The Python package ships a typed facade in `src/rpt` plus a checked-in stub for the compiled nanobind module at `src/rpt/_core.pyi`.
Refresh the extension stub after changing the bindings:
```bash
cmake --build build --target rpt_core_stub
cp build/bindings/rpt/_core.pyi src/rpt/_core.pyi
uv run basedpyright
```
`tests/test_typing_artifacts.py` checks that the checked-in `_core.pyi` matches the generated nanobind stub whenever the build artifact is available.
## Python API Overview
Typical triangulation flow: