Skip to content

Comments

Add missing py.typed in module directory#31

Open
wdlowry wants to merge 1 commit intomailgun:mainfrom
wdlowry:fix-missing-pytyped
Open

Add missing py.typed in module directory#31
wdlowry wants to merge 1 commit intomailgun:mainfrom
wdlowry:fix-missing-pytyped

Conversation

@wdlowry
Copy link

@wdlowry wdlowry commented Feb 12, 2026

Pyright was complaining about a missing stub file. After digging in a little, I noticed that py.typed is missing the module directory. This PR adds it.

Test:

❯ python -m build
...
Successfully built mailgun-1.6.0.post1.dev1.tar.gz and mailgun-1.6.0.post1.dev1-py3-none-any.whl
❯ unzip -l dist/mailgun-1.6.0.post1.dev1-py3-none-any.whl | grep py.typed
        0  02-12-2026 13:23   mailgun/py.typed

@skupriienko
Copy link
Collaborator

skupriienko commented Feb 18, 2026

@wdlowry The file py.typed is packaged in the project folder https://github.com/mailgun/mailgun-python/blob/247d2f4f3587b74430404a4c6a3a19b2e106704d/pyproject.toml#L117C14-L117C19. The Source Distribution on PyPI has it https://pypi.org/project/mailgun/1.6.0/#files (or see here https://inspector.pypi.io/project/mailgun/1.6.0/packages/a6/36/90051ee5ba055ae35f2c6ab8a37429dcaaafef0dcdab6aeb426e03ce1a3c/mailgun-1.6.0.tar.gz/)

Screenshot 2026-02-18 at 15 32 39
python -m build
tar -tf  dist/mailgun-1.6.0.tar.gz | grep py.typed
mailgun-1.6.0/py.typed

But you're right, the wheel file doesn't include it https://inspector.pypi.io/project/mailgun/1.6.0/packages/98/ac/6dfdd71f94d9cc82be5c0925730722b421c123b4471a2706d88e3592480b/mailgun-1.6.0-py3-none-any.whl/

Is it critical for your workflow to have it in the wheel file, or can you use it from the Source Distribution (tar.gz)?

@skupriienko
Copy link
Collaborator

@wdlowry PEP 561 confirms your suggestion: py.typed must physically reside in the mailgun/ package directory.

Will fix it in the next release.

Thank you!

@skupriienko skupriienko self-assigned this Feb 19, 2026
@skupriienko skupriienko added the bug Something isn't working label Feb 19, 2026
@wdlowry
Copy link
Author

wdlowry commented Feb 21, 2026

Will fix it in the next release.

Thank you for getting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants