jefersondaniel/pydantic-mongo

Mypy shows missing stubs or py.typed marker

Closed this issue · 1 comments

Problem

Mypy prompts a warning when trying to import something like AbstractRepository from pydantic_mongo.

Details:

Skipping analyzing "pydantic_mongo": module is installed, but missing library stubs or py.typed marker Mypy[import-untyped](https://mypy.readthedocs.io/en/latest/_refs.html#code-import-untyped)

See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-importsMypy[note](https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports)

Solution

Just add an empty file named py.typed to the package pydantic_mongo and export the file when building the package. Then mypy will analysis types in pydantic_mongo and continue its strict types check.

I'm closing this since py.typed is available in the latest version