jaraco/inflect

provide py.typed marker file

davidism opened this issue · 3 comments

Mypy doesn't recognize that this library provides type annotations because it doesn't have a py.typed file. https://mypy.readthedocs.io/en/stable/installed_packages.html#making-pep-561-compatible-packages

packages that supply type information via type comments or annotations in the code should put a py.typed file in their package directory.

I tried to do this, but I can't get the file to show up in the built wheel. It looks like setuptools_scm is controlling include_pacakge_data instead of MANIFEST.in, and while it's including the file in the sdist, it's not including it in the wheel.

Or if it's not setuptools_scm, it might be a difference in how setuptools handles data files for packages vs py_modules. I'm only familiar with building packages, where the py.typed file exists at the top level of the package and is present in both the wheel and the sdist.

It was the difference between packages and py_modules. If I move inflect.py to inflect/__init__.py and add inflect/py.typed, it shows up in both the wheel and sdist.