[MNT] Add py.typed marker file for PEP 561 compliance#529
Open
direkkakkar319-ops wants to merge 4 commits intosktime:mainfrom
Open
[MNT] Add py.typed marker file for PEP 561 compliance#529direkkakkar319-ops wants to merge 4 commits intosktime:mainfrom
direkkakkar319-ops wants to merge 4 commits intosktime:mainfrom
Conversation
Author
|
Hi @fkiraly i have raised a PR related to this issue . Feedback would be appreciated . |
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.
Reference Issues/PRs
Fixes #528
What does this implement/fix? Explain your changes.
skbase had type hints throughout the codebase but was missing the
py.typedmarker file required by PEP 561. Without this file, typecheckers like
mypyandpyrightsilently skip all type annotationsin skbase when used as an installed package, meaning downstream packages
(sktime, skpro, etc.) got zero type checking benefit.
Changes made:
skbase/py.typedmarker file (PEP 561 requirement)pyproject.tomlto includepy.typedin package data soit is bundled correctly in the distribution
[tool.mypy]config inpyproject.tomlto enable mypyto recognize skbase as a typed package
skbase/tests/test_installation.pytoensure
py.typedis always present in the installed packageBefore this fix mypy reported:
Skipping analyzing 'skbase': module is installed, but missing
library stubs or py.typed marker
After this fix mypy correctly picks up all skbase type annotations.
Does your contribution introduce a new dependency? If yes, which one?
No new dependencies introduced. This is a single empty marker file
plus a small config change.
What should a reviewer concentrate their feedback on?
pyproject.tomlchanges — is thepackage-dataconfig correctfor the build backend being used (setuptools/hatchling)?
test_installation.py— is this the rightplace for it or should it live elsewhere?
py.typedis correctly bundled by checking:unzip -l dist/*.whl | grep py.typedAny other comments?
PEP 561 states: "Package maintainers who wish to support type checking
of their code MUST add a marker file named py.typed to their package."
Since skbase is explicitly designed as a base framework for building
typed, scikit-learn-like packages, PEP 561 compliance is especially
important — the entire downstream ecosystem of skbase users is affected
by this missing marker. This is a minimal, zero-risk change — one empty
file and a few config lines.
Reference: https://peps.python.org/pep-0561/
PR checklist
For all contributions
the PR topic is related to enhancement, CI/CD, maintenance, documentation, or a bug.
For code contributions