pypistats
pypistats copied to clipboard
Declare typing support via `py.typed` file
trafficstars
Running mypy on code that uses the latest version of pypistats fails with the error message "module is installed, but missing library stubs or py.typed marker". A quick look at pypistats's source indicates that it is using type annotations, but because there is no py.typed file, mypy will not use the annotations when type-checking code that uses pypistats.
To resolve this, please do the following:
- [ ] If not already, ensure that all public items in
pypistatsare type-annotated and validated by mypy. - [ ] Add an empty file named
py.typedinsidesrc/pypistats/. - [ ] Ensure that the
pypistats/py.typedfile is included in sdists & wheels built from the project. This may involve configuration specific to your build backend (hatch) that is beyond the scope of this comment.
Further references:
Thanks for the suggestion!
I've made a start on it in https://github.com/hugovk/pypistats/pull/434, but likely won't be able to continue this month due to PyCon US and other travel.
Please feel free to take the branch and finish it off :)