Tinkoff / invest-python

Tinkoff Invest Python gRPC client
https://tinkoff.github.io/invest-python/
Apache License 2.0
303 stars 88 forks source link

[Bug] mypy error about missing library stubs or py.typed marker #149

Closed ikokostya closed 1 year ago

ikokostya commented 1 year ago

Что случилось?

Cтатический анализатор mypy не может найти определения типов для модуля tinkoff.invest:

from tinkoff.invest import Client
$ mypy test.py 
test.py:1: error: Skipping analyzing "tinkoff.invest": module is installed, but missing library stubs or py.typed marker  [import]
test.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

Т.к. данный пакет содержит аннотации типов и это публичный интерфейс, то для решения проблемы можно добавить файл py.typed в пакет. См. https://mypy.readthedocs.io/en/stable/installed_packages.html#creating-pep-561-compatible-packages

Воспроизведение

from tinkoff.invest import Client

Tinkoff Invest Version

0.2.0-beta41

Python Version

3.8

OS

Linux

Логи

No response