From 7afa590c0c5ae79e31479e55610e27fd14b811cd Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Tue, 13 Oct 2026 07:20:02 +0200 Subject: [PATCH] fix: ship py.typed so type checkers read the package's types The package declares "Typing :: Typed" but shipped no PEP 561 marker, so mypy in driver repositories treated it as untyped. Add the marker, include it as package data, and release 4.7.1. --- napalm_device_types/py.typed | 0 pyproject.toml | 5 ++++- tests/test_packaging.py | 9 +++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 napalm_device_types/py.typed create mode 100644 tests/test_packaging.py diff --git a/napalm_device_types/py.typed b/napalm_device_types/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml index 9bea142..7509deb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "napalm-device-types" -version = "4.7.0" +version = "4.7.1" description = "Abstract device-type base classes for NAPALM drivers" readme = "README.md" requires-python = ">=3.10" @@ -61,6 +61,9 @@ dev = [ where = ["."] include = ["napalm_device_types*"] +[tool.setuptools.package-data] +napalm_device_types = ["py.typed"] + [tool.mypy] python_version = "3.10" strict = true diff --git a/tests/test_packaging.py b/tests/test_packaging.py new file mode 100644 index 0000000..2f6dfbc --- /dev/null +++ b/tests/test_packaging.py @@ -0,0 +1,9 @@ +"""The package says it is typed (PEP 561), so it must ship the marker.""" + +from pathlib import Path + +import napalm_device_types + + +def test_the_package_ships_py_typed(): + assert (Path(napalm_device_types.__file__).parent / "py.typed").is_file()