Since prometheus_client provides some types, adding it to ignore_missing_imports doesnt work. The existence of this file: https://github.com/prometheus/client_python/blob/master/prometheus_client/py.typed
means that ignore_missing_imports is ignored with prometheus_client.
Counter inc is typed:
https://github.com/prometheus/client_python/blob/master/prometheus_client/metrics.py#L272-L280
However, Histogram isnt typed, including observe:
https://github.com/prometheus/client_python/blob/master/prometheus_client/metrics.py#L464-L476
This causes mypy --strict to fail when using Histogram. Typing all metrics will allow strict mypy users to stop adding # type: ignore anywhere this function is used.
Since prometheus_client provides some types, adding it to
ignore_missing_importsdoesnt work. The existence of this file: https://github.com/prometheus/client_python/blob/master/prometheus_client/py.typedmeans that
ignore_missing_importsis ignored withprometheus_client.Counter
incis typed:https://github.com/prometheus/client_python/blob/master/prometheus_client/metrics.py#L272-L280
However, Histogram isnt typed, including
observe:https://github.com/prometheus/client_python/blob/master/prometheus_client/metrics.py#L464-L476
This causes
mypy --strictto fail when using Histogram. Typing all metrics will allow strict mypy users to stop adding# type: ignoreanywhere this function is used.