noirello / bonsai

Simple Python 3 module for LDAP, using libldap2 and winldap C libraries.
MIT License
116 stars 32 forks source link

PEP 561 type information omitted #74

Closed JacobHenner closed 1 year ago

JacobHenner commented 1 year ago

bonsai appears to be missing PEP 561 type information, even though bonsai itself has type annotations. This is preventing mypy from type checking when the library is used in other projects:

error: Skipping analyzing "bonsai": module is installed, but missing library stubs or py.typed marker
note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
noirello commented 1 year ago

I started a new branch, added the py.typed file. The module indeed has some type annotations, and I'm trying to improve it, but it's unlikely that it's every going to be perfect. A lots of dynamic feature is going on under the hood.

noirello commented 1 year ago

The py.typed file is included in the latest 1.5.1 release.

But like I said, the type annotations aren't the best of the module. Made a couple of bad design decisions over the years in regard of typings, that could only be addressed in a new, major release version. Not sure that's ever going to happen, though.