Skip to content

[MNT] Add py.typed marker file for PEP 561 compliance#529

Open
direkkakkar319-ops wants to merge 4 commits intosktime:mainfrom
direkkakkar319-ops:issue#528-DirekKakkar
Open

[MNT] Add py.typed marker file for PEP 561 compliance#529
direkkakkar319-ops wants to merge 4 commits intosktime:mainfrom
direkkakkar319-ops:issue#528-DirekKakkar

Conversation

@direkkakkar319-ops
Copy link
Copy Markdown

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.typed marker file required by PEP 561. Without this file, type
checkers like mypy and pyright silently skip all type annotations
in skbase when used as an installed package, meaning downstream packages
(sktime, skpro, etc.) got zero type checking benefit.

Changes made:

  • Created empty skbase/py.typed marker file (PEP 561 requirement)
  • Updated pyproject.toml to include py.typed in package data so
    it is bundled correctly in the distribution
  • Added [tool.mypy] config in pyproject.toml to enable mypy
    to recognize skbase as a typed package
  • Added regression test in skbase/tests/test_installation.py to
    ensure py.typed is always present in the installed package

Before 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.toml changes — is the package-data config correct
    for the build backend being used (setuptools/hatchling)?
  • The regression test in test_installation.py — is this the right
    place for it or should it live elsewhere?
  • Verify py.typed is correctly bundled by checking:
    unzip -l dist/*.whl | grep py.typed

Any 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
  • I've reviewed the project documentation on contributing
  • I've added myself to the list of contributors.
  • The PR title starts with either [ENH], [CI/CD], [MNT], [DOC], or [BUG] indicating whether
    the PR topic is related to enhancement, CI/CD, maintenance, documentation, or a bug.
For code contributions
  • Unit tests have been added covering code functionality
  • Appropriate docstrings have been added (see documentation standards)
  • New public functionality has been added to the API Reference

@direkkakkar319-ops direkkakkar319-ops marked this pull request as ready for review March 11, 2026 03:59
@direkkakkar319-ops direkkakkar319-ops marked this pull request as draft March 11, 2026 04:00
@direkkakkar319-ops direkkakkar319-ops marked this pull request as ready for review March 11, 2026 04:51
@direkkakkar319-ops
Copy link
Copy Markdown
Author

Hi @fkiraly i have raised a PR related to this issue . Feedback would be appreciated .

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.

[MNT] Add py.typed marker file for PEP 561 compliance

1 participant