miguelgrinberg / python-socketio

Python Socket.IO server and client
MIT License
4.01k stars 589 forks source link

Request: type hints (e.g. for mypy) #1276

Closed jamesbraza closed 1 year ago

jamesbraza commented 1 year ago

Is your feature request related to a problem? Please describe.

I run mypy on my code, and it's throwing errors for not being typed:

a.py:19:1: error: Skipping analyzing "socketio": module is installed, but missing library stubs or py.typed marker  [import-untyped]
    from socketio import Client
    ^

Describe the solution you'd like

Type hints to be added to the repo, or alternately a type stub package to be installable.

Describe alternatives you've considered

Disabling mypy for python-socketio like the below pyproject.toml config:

[[tool.mypy.overrides]]
# Suppresses error messages about imports that cannot be resolved.
ignore_missing_imports = true
# Per-module configuration options
module = ["socketio.*"]
miguelgrinberg commented 1 year ago

Unfortunately I do not have the time to maintain type hints on all my packages at this time. Once the typing solution in Python becomes more manageable I will consider doing it, but for now my suggestion is that you contribute a stub package to typeshed.

andy-takker commented 9 months ago

@miguelgrinberg Hello, can I create PR with adding typehints for this project?

miguelgrinberg commented 9 months ago

My answer hasn't changed. You are welcome to contribute type hints for this package to typeshed.