Skip to content

[packaging] Add PEP 561 py.typed marker and explicit SceneManager re-export - #617

Merged
Breakthrough merged 1 commit into
Breakthrough:mainfrom
M-Colley:feat/pep561-py-typed
Nov 22, 2026
Merged

Breakthrough merged 1 commit into
Breakthrough:mainfrom
M-Colley:feat/pep561-py-typed

Conversation

@M-Colley

Copy link
Copy Markdown
Contributor

Summary

Downstream projects running mypy --strict fail on from scenedetect import ContentDetector, detect (Skipping analyzing "scenedetect": module is installed, but missing library stubs or py.typed marker [import-untyped]) because scenedetect omits a PEP 561 scenedetect/py.typed marker file. In addition, line 79 of scenedetect/__init__.py imports SceneManager without explicit as SceneManager re-export syntax, which triggers [attr-defined] under no_implicit_reexport once py.typed is enabled.

Reproduction

mypy --strict -c "from scenedetect import ContentDetector, SceneManager, detect"

Fix and Verification

  1. Add scenedetect/py.typed and register it in MANIFEST.in and [tool.setuptools.package-data] alongside the "Typing :: Typed" classifier across pyproject.toml, packaging/variants/pyproject-scenedetect.toml, and packaging/variants/pyproject-scenedetect-headless.toml.
  2. Update scenedetect/__init__.py to export SceneManager as SceneManager matching all other top-level re-exports.
  3. Verified via packaging/build_all.py that scenedetect/py.typed is packaged inside all four built wheels and sdists, and verified downstream mypy --strict passes with zero errors.

…export

Ship scenedetect/py.typed across both scenedetect and
scenedetect-headless distributions, add the Typing :: Typed classifier,
and use redundant-alias re-export for SceneManager in
scenedetect/__init__.py so downstream mypy --strict consumers type-check
cleanly.

@Breakthrough Breakthrough left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I didn't know this was required, thanks for letting me know.

@Breakthrough Breakthrough added this to the 0.7.4 milestone Nov 22, 2026
@Breakthrough
Breakthrough merged commit 6acce88 into Breakthrough:main Nov 22, 2026
23 checks passed
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.

3 participants