scott-griffiths / bitstring

A Python module to help you manage your bits
https://bitstring.readthedocs.io/en/stable/index.html
MIT License
404 stars 68 forks source link

Missing py.typed marker #248

Closed brussee closed 1 year ago

brussee commented 1 year ago

Would you mind adding a py.typed file? https://peps.python.org/pep-0561/ Because I noticed bitstring makes use of type hinting 👍 but mypy complains: "missing library stubs or py.typed marker".

Thanks for this helpful and user friendly library!

scott-griffiths commented 1 year ago

Hi. Yes I will take a look at this for the next point update (probably around Christmas). It's not something that I've used before so I may have to try mypy too!

altendky commented 1 year ago

https://peps.python.org/pep-0561/#packaging-type-information

This PEP does not support distributing typing information as part of module-only distributions or single-file modules within namespace packages.

:[

I guess that's another reason for me to be lazy and always make projects with top level packages, not single modules.

Would you be interested in a PR exploring this possibility? I would think it might just be a matter of moving bitstring.py to bitstring/__init__.py and then whatever according project and CI adjustments are needed to track that. That should keep the same import behavior for users.

scott-griffiths commented 1 year ago

@altendky Hi, sorry I missed the end of your message - thanks for the offer but I should be able to make the changes myself. I see my before Christmas estimate was a bit optimistic!

altendky commented 1 year ago

It's always before some Christmas... :clock5: :earth_asia:

scott-griffiths commented 1 year ago

Done in PR #256 - I'll try to do a maintenance release soon 🤞

scott-griffiths commented 1 year ago

bitstring 4.0.2 now released. Mypy working for me at least!