pixelmatch-py, a Python library I maintained for comparing images, received a Pull Request to add type hints about 10 months ago. After merging this PR & releasing a new version, I thought the library's users will magically get their type working.
Until today, I was reading cryptography's Changelog and a line got my attention:
py.typedfile so that
mypywill know to use our type annotations.
It's faily simple to include this file: just
py.typed file in your package directory and include it in your distribution.
I'm using poetry,
so I added
[tool.poetry] section of
Update: As pointed out by Jürgen Gmach, poetry includes all files in your packages (including
py.typed file!) by default, so there's no need to include the file manually.
If you're using
setup.py, you can add
Release a new version for your package then type informations from your packages should works.
If you're a Python package maintainer, be sure to include
py.typed file for your typed package!