Skip to content

Add py.typed marker for mypy support - #956

Open
akshathayadav378-boop wants to merge 1 commit into
AnswerDotAI:mainfrom
akshathayadav378-boop:add-py-typed-907
Open

akshathayadav378-boop wants to merge 1 commit into
AnswerDotAI:mainfrom
akshathayadav378-boop:add-py-typed-907

Conversation

@akshathayadav378-boop

@akshathayadav378-boop akshathayadav378-boop commented Nov 11, 2026 •

Copy link
Copy Markdown

Related Issue
Fixes #907

Proposed Changes
Add a PEP 561 py.typed marker to the fasthtml package so that mypy (and other type checkers) stop reporting import-untyped / "missing library stubs or py.typed marker" for fasthtml.common when 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.typed so 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) contain fasthtml/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 x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist
Go over all the following points, and put an x in all the boxes that apply:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I am aware that this is an nbdev project, and I have edited, cleaned, and synced the source notebooks instead of editing .py or .md files directly.

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.

This branch has not been deployed

No deployments
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.

[FEATURE] Please add py.typed for mypy

1 participant