Skip to content

Add py.typed marker files to all packages (PEP 561)#987

Open
alexchenai wants to merge 1 commit intotestcontainers:mainfrom
alexchenai:add-py-typed-markers
Open

Add py.typed marker files to all packages (PEP 561)#987
alexchenai wants to merge 1 commit intotestcontainers:mainfrom
alexchenai:add-py-typed-markers

Conversation

@alexchenai
Copy link

Summary

  • Adds empty py.typed marker files (per PEP 561) to core and all module packages
  • Previously only sftp and mailpit had the marker, causing mypy to skip type-checking for all other testcontainers imports with the error: module is installed, but missing library stubs or py.typed marker [import]
  • 46 py.typed files added (zero code changes)

Test plan

  • Verify mypy no longer reports missing library stubs or py.typed marker for any testcontainers module
  • Confirm the built wheel includes py.typed files (they are under paths already in tool.hatch.build.targets.wheel.packages)
  • Existing CI tests should pass unchanged since this only adds empty marker files

Fixes #305

Only the sftp and mailpit modules had py.typed markers. This adds the
marker to core and all remaining modules so that mypy and other type
checkers recognise the package as typed without needing
--ignore-missing-imports.

Fixes testcontainers#305
Copy link

@themavik themavik left a comment

Choose a reason for hiding this comment

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

Reviewed the changes — the implementation looks correct. Adding py.typed markers per PEP 561 improves type checker support for downstream consumers.

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.

Mark packages as typed

2 participants