Describe the issue
skbase already includes type hints across its codebase (function
signatures, return types, etc.) but is missing the py.typed marker
file required by PEP 561.
Without this file, type checkers like mypy and pyright completely
ignore all type annotations in skbase when used as an installed package.
This means downstream packages (sktime, skpro, and any user building
on top of skbase) get zero benefit from the existing type hints — mypy
silently skips them and treats all skbase imports as Any.
You can verify the issue right now:
pip install scikit-base
python -m mypy your_script.py # skbase types are ignored
Mypy will report something like:
error: Skipping analyzing 'skbase': module is installed,
but missing library stubs or py.typed marker
Describe the fix
-
Create an empty py.typed marker file at the root of the package:
touch skbase/py.typed
-
Ensure it is included in the distribution by verifying
pyproject.toml includes it under package data. With modern
setuptools and pyproject.toml, this is typically automatic,
but should be explicitly confirmed:
[tool.setuptools.package-data]
skbase = ["py.typed"]
-
Add a CI check or mypy config in pyproject.toml to prevent
future regressions:
[tool.mypy]
python_version = "3.10"
packages = ["skbase"]
That is the entire fix — a single empty file plus a config confirmation.
Additional context
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 here — the entire downstream ecosystem of skbase users is
affected by this missing marker.
Reference: https://peps.python.org/pep-0561/
Describe the issue
skbase already includes type hints across its codebase (function
signatures, return types, etc.) but is missing the
py.typedmarkerfile required by PEP 561.
Without this file, type checkers like
mypyandpyrightcompletelyignore all type annotations in skbase when used as an installed package.
This means downstream packages (sktime, skpro, and any user building
on top of skbase) get zero benefit from the existing type hints — mypy
silently skips them and treats all skbase imports as
Any.You can verify the issue right now:
pip install scikit-base
python -m mypy your_script.py # skbase types are ignored
Mypy will report something like:
error: Skipping analyzing 'skbase': module is installed,
but missing library stubs or py.typed marker
Describe the fix
Create an empty
py.typedmarker file at the root of the package:touch skbase/py.typed
Ensure it is included in the distribution by verifying
pyproject.tomlincludes it under package data. With modernsetuptools and pyproject.toml, this is typically automatic,
but should be explicitly confirmed:
[tool.setuptools.package-data]
skbase = ["py.typed"]
Add a CI check or mypy config in
pyproject.tomlto preventfuture regressions:
[tool.mypy]
python_version = "3.10"
packages = ["skbase"]
That is the entire fix — a single empty file plus a config confirmation.
Additional context
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 here — the entire downstream ecosystem of skbase users is
affected by this missing marker.
Reference: https://peps.python.org/pep-0561/