Skip to content

typing: ship a py.typed marker so downstream mypy/pyright actually see our type hints (PEP 561) #13

Description

@Koukyosyumei

Problem

The SDK is fully type-annotated — e.g. src/h5i/orchestra/_errors.py (def __init__(self, message: str, code: int, kind: str | None = None)), _conductor.py, policy.py — but the package ships no py.typed marker:

$ find src -name py.typed
(nothing)

Per PEP 561, without that marker, type checkers in downstream projects treat h5i.orchestra as untyped and silently ignore every annotation we wrote. Users of mypy/pyright get no completions-with-types, no signature checking, nothing — the annotations only benefit our own test suite.

Suggested fix

  • Add an empty src/h5i/py.typed file (the package root that [tool.hatch.build.targets.wheel] ships is src/h5i).
  • Verify the marker lands in the wheel: python -m build && unzip -l dist/*.whl | grep py.typed.
  • Bonus: add a tiny smoke check to CI (or docs) showing mypy resolves types from the installed package, e.g. mypy -c "from h5i.orchestra import Conductor; reveal_type(Conductor)".

The core change is literally one empty file plus a build check — a perfect first contribution — but it meaningfully improves the experience of every typed downstream project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions