pusher / pusher-http-python

Pusher Channels HTTP API library for Python
https://pusher.com/docs/server_api_guide
MIT License
375 stars 112 forks source link

PEP 561: Types #196

Closed robbieculkin closed 1 year ago

robbieculkin commented 1 year ago

Many applications use mypy (or similar) for static typechecking. Anyone using a typechecker needs to explicitly ignore checking on pusher imports, since types don't appear to be defined according to the PEP 561 spec.

Is there anything on the roadmap to add PEP 561 compliance to the package?

benjamin-tang-pusher commented 1 year ago

Hi, I ran mypy against pusher.py and couldn't couldn't detect the issue. How are you invoking the command?

(venv) benjamintang@Benjamins-MacBook-Pro pusher-http-python % mypy pusher/pusher.py 
Success: no issues found in 1 source file
robbieculkin commented 1 year ago

While mypy may succeed when running on files in this repo directly, the pusher repo needs to provide either

  1. a py.typed marker file and inline type-annotated function signatures
  2. a stub package with type definitions

in order to comply with the PEP 561 spec, and for mypy type checking to work for any codebase importing from pusher.

benjamin-tang-pusher commented 1 year ago

I will add this to our feature requests for our engineering to prioritise.