diff options
| author | Bobby <[email protected]> | 2026-07-15 13:36:28 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-07-15 13:36:28 +0530 |
| commit | 496734c57c0a065119263c6fdca4598bb8e423f5 (patch) | |
| tree | 4a838ec70f2756fe5b4fa815493650c8d08b9c7d /tests/pattern/call.test.py | |
| parent | 64655e3d779a9a02ce730cad14763e613a2623e2 (diff) | |
| parent | 742ead17bb2f31c75b8839fb8d4a9b31e7f7ee74 (diff) | |
| download | edify-496734c57c0a065119263c6fdca4598bb8e423f5.tar.xz edify-496734c57c0a065119263c6fdca4598bb8e423f5.zip | |
feat(typing): PEP 561 marker, strict-mode gates, and full public-surface annotations (#279)
Ships the static-typing surface end to end.
- Installs the `edify/py.typed` marker so downstream code sees `edify`
as a typed distribution, and force-includes it in the wheel.
- Adds a `[tool.mypy]` block that runs `mypy --strict` against `edify.*`
(with `ignore_missing_imports` scoped to `regex` and `graphviz`), and a
`[tool.pyright]` block with `typeCheckingMode = "strict"` bound to
`include = ["edify"]`.
- Pins `mypy==1.13.0` and `pyright==1.1.389` in the dev group and
refreshes `uv.lock`.
- Annotates the full public surface: `Self` on every fluent chain
method, `TypeVar`-generic private helpers across the mixins, precise
element unions on `render_element` / `merge` / `fuse`, `FrameType` on
the caller-context walker, a `JSONValue` recursive type over the
serialize layer (no `Any`, no `object`), and precise dict types on the
`class_for` / `kind_for` registry.
- Introduces a typed `engine: Literal["re", "regex"]` kwarg on
`to_regex`, with `EngineNotWiredError` (annotated summary + pointer
block + `= note:` + `help:`) surfacing when a caller asks for an engine
that is not wired in this build.
- Introduces `edify/builder/types/protocol.py::BuilderProtocol` — a
`runtime_checkable` `Protocol` that declares the shared attribute +
method surface every mixin assumes about `self`, so mixins in isolation
see the full chain surface.
- Introduces `edify/serialize/types.py::JSONValue` (recursive: `str |
int | float | bool | None | list[JSONValue] | dict[str, JSONValue]`) and
threads it through `element_to_dict`, `state_to_dict`, and the load path
(now returning `BuilderState` to break a circular import with
`Pattern`).
- Adds a discipline test that grep-fails on any bare `# type: ignore` or
`# pyright: ignore` in `edify/`, so every suppression must carry a code
and a reason (there are none in this branch).
- Wires `mypy` and `pyright` as required CI matrix entries in
`.github/workflows/github-actions.yml`, both running `--strict` against
`edify/`.
Closes #71, closes #84, closes #85, closes #86, closes #87, closes #88,
closes #89, closes #90, closes #91, closes #92, closes #93, closes #94,
closes #95.
Diffstat (limited to 'tests/pattern/call.test.py')
0 files changed, 0 insertions, 0 deletions
