Add py.typed marker files to all packages (PEP 561)#987
Open
alexchenai wants to merge 1 commit intotestcontainers:mainfrom
Open
Add py.typed marker files to all packages (PEP 561)#987alexchenai wants to merge 1 commit intotestcontainers:mainfrom
alexchenai wants to merge 1 commit intotestcontainers:mainfrom
Conversation
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
themavik
reviewed
Mar 19, 2026
themavik
left a comment
There was a problem hiding this comment.
Reviewed the changes — the implementation looks correct. Adding py.typed markers per PEP 561 improves type checker support for downstream consumers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
py.typedmarker files (per PEP 561) to core and all module packagessftpandmailpithad 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]py.typedfiles added (zero code changes)Test plan
mypyno longer reportsmissing library stubs or py.typed markerfor any testcontainers modulepy.typedfiles (they are under paths already intool.hatch.build.targets.wheel.packages)Fixes #305