Skip to content

chore: ship PEP 561 py.typed marker#431

Open
denrou wants to merge 1 commit into
google-research:masterfrom
denrou:feat/py-typed-marker
Open

chore: ship PEP 561 py.typed marker#431
denrou wants to merge 1 commit into
google-research:masterfrom
denrou:feat/py-typed-marker

Conversation

@denrou

@denrou denrou commented May 22, 2026

Copy link
Copy Markdown

Summary

Adds an empty src/timesfm/py.typed marker file (PEP 561) and includes
it in the built wheel via [tool.setuptools.package-data].

Why

Without the marker, downstream type checkers (mypy, pyright, pylance)
treat every symbol imported from timesfm as Any — ignoring the
inline annotations that are already present throughout configs.py,
timesfm_2p5/*.py, torch/*.py, and flax/*.py. Shipping the marker
lets users get type information from timesfm in their typed
codebases.

PEP 561 explicitly allows partially-typed packages, so no annotation
work is required alongside this change — symbols that are unannotated
will continue to be inferred as Any, exactly as they are today for
the package's own internal type-checking.

Verification

Built the wheel locally and confirmed the marker is included:

$ python -m build --wheel
...
Successfully built timesfm-2.0.0-py3-none-any.whl

$ unzip -l dist/timesfm-2.0.0-py3-none-any.whl | grep py.typed
    0  ...  timesfm/py.typed

Test plan

  • python -m build --wheel succeeds
  • py.typed is present in the wheel under timesfm/
  • CI build job (.github/workflows/main.yml) passes

Add an empty `src/timesfm/py.typed` marker and include it in the wheel
via `[tool.setuptools.package-data]` so that downstream type checkers
(mypy, pyright, pylance) honor the existing inline type annotations
instead of treating everything imported from `timesfm` as `Any`.

The package already carries partial type annotations throughout
`configs.py`, `timesfm_2p5/*.py`, `torch/*.py`, and `flax/*.py`. PEP 561
explicitly supports partially typed packages, so no annotation changes
are needed alongside the marker.

Verified the marker lands in the built wheel:

    $ python -m build --wheel
    $ unzip -l dist/timesfm-2.0.0-py3-none-any.whl | grep py.typed
        0  ...  timesfm/py.typed
@google-cla

google-cla Bot commented May 22, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

1 participant