stevesimmons / uuid7

UUID version 7, which are time-sortable (following the Peabody RFC4122 draft)
MIT License
95 stars 9 forks source link

Add py.typed file for PEP 561 compatible packages #5

Open vtananko opened 2 months ago

vtananko commented 2 months ago

Description

When you import a module, mypy may report that it is unable to follow the import.

What I Did

$ cat test.py 
from uuid_extensions import uuid7

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

$ mypy --version
mypy 1.11.1 (compiled: yes)

What I Fix It

$ touch .venv/lib/python3.12/site-packages/uuid_extensions/py.typed
$ mypy test.py 
Success: no issues found in 1 source file