Repository navigation
Add py.typed marker for mypy support - #956
Open
akshathayadav378-boop wants to merge 1 commit into
Open
akshathayadav378-boop wants to merge 1 commit into
akshathayadav378-boop wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Related Issue
Fixes #907
Proposed Changes
Add a PEP 561
py.typedmarker to thefasthtmlpackage so that mypy (and other type checkers) stop reportingimport-untyped/ "missing library stubs or py.typed marker" forfasthtml.commonwhen the package is installed.The change is packaging-only, in three files:
fasthtml/py.typed— new empty marker file, as requested in [FEATURE] Please add py.typed for mypy #907.MANIFEST.in—include fasthtml/py.typedso the marker is present in the sdist.pyproject.toml—[tool.setuptools.package-data] fasthtml = ["py.typed"]so the marker is also included in the wheel. Without these two packaging entries the marker file alone would not reliably ship to PyPI.Verification: built the package locally before submitting (
python -m build, version 0.14.23) and inspected the artifacts — both the sdist (python_fasthtml-0.14.23.tar.gz) and the wheel (python_fasthtml-0.14.23-py3-none-any.whl) containfasthtml/py.typed.Note on nbdev: this PR intentionally does not edit any notebook-generated source files — it only adds the marker file and the packaging configuration needed to distribute it, so there is no notebook counterpart to sync.
Types of changes
What types of changes does your code introduce? Put an
xin all the boxes that apply:Checklist
Go over all the following points, and put an
xin all the boxes that apply:On the unchecked boxes: no documentation change is needed for a packaging marker, and there is no runtime behavior to unit-test — the relevant verification is the build-artifact inspection described above, which was run and passed for both the sdist and the wheel.
Additional Information
Happy to adjust (e.g. marker only, without the packaging-config changes) if maintainers prefer a smaller diff.