pystatsd icon indicating copy to clipboard operation
pystatsd copied to clipboard

Type hints & PEP 561 packaging

Open tuukkamustonen opened this issue 3 years ago • 2 comments

Add type hints to all (public API) code make the distribution PEP 561 compliant. This allows mypy (and other tools?) to find the type hints and use them in linting.

In practice, add py.typed file to statsd package, and include it in the package:

setup(
    package_data={'statsd': ['py.typed']},
    zip_safe=False,  # not needed with wheels, AFAIK
)

PEP 561: https://www.python.org/dev/peps/pep-0561/

tuukkamustonen avatar May 07 '21 09:05 tuukkamustonen

I want to give it a try but with dropping support for Python 2.7. Writing all type annotations as stubs or comments is a bit painful and hard to maintain.

orsinium avatar Nov 01 '21 14:11 orsinium

Python 2.7 is officially dropped!

jsocol avatar Nov 06 '22 00:11 jsocol