feat: ship py.typed and enforce mypy --strict in CI - #64
Closed
higagan wants to merge 1 commit into
Closed
Conversation
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.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The package has full type hints but shipped no PEP 561 marker, so consumers (and AI coding assistants reading type info) saw
Anyeverywhere.decorator.pyinvests inParamSpec,TypeVar, and two@overloaddeclarations to preserve tool signatures — all of it was discarded without the marker.What this adds:
src/modelfuzz/py.typedmarker in the wheel and sdistTyping :: Typedclassifier inpyproject.tomlmypy --strict src/modelfuzzas a CI step so type regressions fail the workflowmypyadded to dev dependenciesFixes the 10 existing
mypy --stricterrors:decorator.py: annotateshield_tool,_enforce,_wrap; fix list variance on the default engine; annotate async wrapperscli.py: annotate_make_client,_probe,_next_attack; tightenHTTP_POST_TOOLtolist[dict[str, object]]Verified:
mypy --strict src/modelfuzz— no issues found in 6 source filesruff check+ruff format --check— cleanpy.typedpresent in both the built wheel and sdistCloses #56.