Skip to content

Track 2: Add PEP 561 py.typed marker #13

@nielsweistra

Description

@nielsweistra

Track 2: Add PEP 561 py.typed marker

Overview

PEP 561 requires packages that ship inline type annotations to include an empty
py.typed marker file. Without it, mypy and pyright will ignore the package's
type annotations when used as a dependency.

Goal

Add py.typed to the package so downstream consumers get full type checking
support.

Implementation Steps

  1. Create an empty file at src/itl_policy_builder/py.typed
  2. Add py.typed to package-data / include in pyproject.toml so it is
    shipped in the sdist/wheel

pyproject.toml change

In the [tool.setuptools.package-data] (or equivalent) section:

[tool.setuptools.package-data]
itl_policy_builder = ["py.typed"]

Acceptance Criteria

  • src/itl_policy_builder/py.typed file exists (empty)
  • py.typed included in the built wheel (python -m build then unzip -l dist/*.whl)
  • mypy --strict on a consumer package resolves types from this package without errors
  • No breaking changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions