From 9c8905b95ef100fea7dfe7d5c26c0ce3f8eba78a Mon Sep 17 00:00:00 2001 From: Mark Colley <39366189+M-Colley@users.noreply.github.com> Date: Sun, 22 Nov 2026 02:21:53 +0000 Subject: [PATCH] [packaging] Add PEP 561 py.typed marker and explicit SceneManager re-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. --- MANIFEST.in | 1 + packaging/variants/pyproject-scenedetect-headless.toml | 4 ++++ packaging/variants/pyproject-scenedetect.toml | 4 ++++ pyproject.toml | 4 ++++ scenedetect/__init__.py | 2 +- scenedetect/py.typed | 0 6 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 scenedetect/py.typed diff --git a/MANIFEST.in b/MANIFEST.in index cf223d6b..0e8ba905 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,4 +9,5 @@ include LICENSE include pyproject.toml include scenedetect.cfg include packaging/package-info.rst +include scenedetect/py.typed recursive-include docs * diff --git a/packaging/variants/pyproject-scenedetect-headless.toml b/packaging/variants/pyproject-scenedetect-headless.toml index eeea9c43..710599f9 100644 --- a/packaging/variants/pyproject-scenedetect-headless.toml +++ b/packaging/variants/pyproject-scenedetect-headless.toml @@ -49,6 +49,7 @@ classifiers = [ "Topic :: Multimedia :: Video :: Conversion", "Topic :: Multimedia :: Video :: Non-Linear Editor", "Topic :: Utilities", + "Typing :: Typed", ] dependencies = [ # click 8.3.0 specifically is excluded per https://scenedetect.com/issues/521; 8.3.1+ are fine. @@ -78,5 +79,8 @@ include-package-data = true [tool.setuptools.packages.find] include = ["scenedetect*"] +[tool.setuptools.package-data] +scenedetect = ["py.typed"] + [tool.setuptools.dynamic] version = { attr = "scenedetect.__version__" } diff --git a/packaging/variants/pyproject-scenedetect.toml b/packaging/variants/pyproject-scenedetect.toml index 49ca2b04..2bba617d 100644 --- a/packaging/variants/pyproject-scenedetect.toml +++ b/packaging/variants/pyproject-scenedetect.toml @@ -48,6 +48,7 @@ classifiers = [ "Topic :: Multimedia :: Video :: Conversion", "Topic :: Multimedia :: Video :: Non-Linear Editor", "Topic :: Utilities", + "Typing :: Typed", ] dependencies = [ # click 8.3.0 specifically is excluded per https://scenedetect.com/issues/521; 8.3.1+ are fine. @@ -77,5 +78,8 @@ include-package-data = true [tool.setuptools.packages.find] include = ["scenedetect*"] +[tool.setuptools.package-data] +scenedetect = ["py.typed"] + [tool.setuptools.dynamic] version = { attr = "scenedetect.__version__" } diff --git a/pyproject.toml b/pyproject.toml index 29246a1c..7afb4d9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ classifiers = [ "Topic :: Multimedia :: Video :: Conversion", "Topic :: Multimedia :: Video :: Non-Linear Editor", "Topic :: Utilities", + "Typing :: Typed", ] # This root config is the `scenedetect` package (opencv-python, the CLI dependencies and # the `scenedetect` console script) and is what `pip install -e .[dev]` installs for @@ -84,6 +85,9 @@ include-package-data = true [tool.setuptools.packages.find] include = ["scenedetect*"] +[tool.setuptools.package-data] +scenedetect = ["py.typed"] + [tool.setuptools.dynamic] version = { attr = "scenedetect.__version__" } diff --git a/scenedetect/__init__.py b/scenedetect/__init__.py index c07e60c5..91656e41 100644 --- a/scenedetect/__init__.py +++ b/scenedetect/__init__.py @@ -76,7 +76,7 @@ ) from scenedetect.stats_manager import StatsManager as StatsManager from scenedetect.stats_manager import StatsFileCorrupt as StatsFileCorrupt -from scenedetect.scene_manager import SceneManager +from scenedetect.scene_manager import SceneManager as SceneManager # Used for module identification and when printing version & about info # (e.g. calling `scenedetect version` or `scenedetect about`). diff --git a/scenedetect/py.typed b/scenedetect/py.typed new file mode 100644 index 00000000..e69de29b