libgit2 / pygit2

Python bindings for libgit2
https://www.pygit2.org/
Other
1.58k stars 382 forks source link

Type hints are not found by Mypy #1256

Closed Delgan closed 6 months ago

Delgan commented 6 months ago

Hi!

Running mypy (1.7.1) on file importing pygit2 (1.13.3) causes the following error:

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

It's surprising because pygit2 does have a stubs file.

I think this is because py.typed must be added and installed.

Delgan commented 6 months ago

Closing as duplicate of #709