Skip to content

feat: ship py.typed and enforce mypy --strict in CI - #64

Closed
higagan wants to merge 1 commit into
mainfrom
feat/py-typed-mypy-strict
Closed

feat: ship py.typed and enforce mypy --strict in CI#64
higagan wants to merge 1 commit into
mainfrom
feat/py-typed-mypy-strict

Conversation

@higagan

@higagan higagan commented Aug 4, 2026

Copy link
Copy Markdown
Owner

The package has full type hints but shipped no PEP 561 marker, so consumers (and AI coding assistants reading type info) saw Any everywhere. decorator.py invests in ParamSpec, TypeVar, and two @overload declarations to preserve tool signatures — all of it was discarded without the marker.

What this adds:

  • src/modelfuzz/py.typed marker in the wheel and sdist
  • Typing :: Typed classifier in pyproject.toml
  • mypy --strict src/modelfuzz as a CI step so type regressions fail the workflow
  • mypy added to dev dependencies

Fixes the 10 existing mypy --strict errors:

  • decorator.py: annotate shield_tool, _enforce, _wrap; fix list variance on the default engine; annotate async wrappers
  • cli.py: annotate _make_client, _probe, _next_attack; tighten HTTP_POST_TOOL to list[dict[str, object]]

Verified:

  • mypy --strict src/modelfuzz — no issues found in 6 source files
  • ruff check + ruff format --check — clean
  • 105 tests pass
  • py.typed present in both the built wheel and sdist

Closes #56.

The package has full type hints but shipped no PEP 561 marker, so
consumers (and AI coding assistants reading type info) saw Any
everywhere. decorator.py invests in ParamSpec, TypeVar, and two
@overload declarations to preserve tool signatures — all of it was
discarded without the marker.

Add src/modelfuzz/py.typed to the wheel and sdist, add the
Typing :: Typed classifier, and add mypy --strict src/modelfuzz as
a CI step so type regressions fail the workflow.

Fix the 10 existing mypy --strict errors:
- decorator.py: annotate shield_tool, _enforce, _wrap; fix list
  variance on the default engine; annotate async wrappers
- cli.py: annotate _make_client, _probe, _next_attack; tighten
  HTTP_POST_TOOL to list[dict[str, object]]

Closes #56.
@higagan

higagan commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

Changes already landed on main via #65 — the E2E test branch was cut from this branch, so the squash merge carried py.typed, the mypy --strict fixes, and the CI step through. Verified: py.typed is on main, mypy --strict passes, the Typing :: Typed classifier is in pyproject.toml.

@higagan higagan closed this Aug 4, 2026
@higagan
higagan deleted the feat/py-typed-mypy-strict branch August 4, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ship py.typed so AI assistants and type checkers see real signatures

1 participant