The library's code contains type hints (great!) but those are not advertised so our code doesn't use them (it doesn't even look for them). According to PEP 561, you would need to package and distribute a py.typed file with your library for those types to be used easily.
Steps To Reproduce
Write some python code based on algoliasearch.
In requirements.txt:
algoliasearch==2.5.0
mypy==0.910
In the code:
from algoliasearch import search_client
search_client.SearchClient.create(
os.getenv('ALGOLIA_APP_ID', ''),
os.getenv('ALGOLIA_API_KEY', '')).init_index(3)
Running mypy doesn't yell, where it should actually fail with the following error:
error: Argument 1 to "init_index" of "SearchClient" has incompatible type "int"; expected "str"
Description
The library's code contains type hints (great!) but those are not advertised so our code doesn't use them (it doesn't even look for them). According to PEP 561, you would need to package and distribute a
py.typed
file with your library for those types to be used easily.Steps To Reproduce
Write some python code based on
algoliasearch
.In
requirements.txt
:In the code:
Running
mypy
doesn't yell, where it should actually fail with the following error: