cloudpathlib
cloudpathlib copied to clipboard
Can't use cloudpathlib with mypy
I'm interested in using cloudpathlib in my project, but I'm currently not able to because of the following error:
[file in my project]:8:1: error: Skipping analyzing "cloudpathlib": module is installed, but missing library stubs or py.typed marker [import]
According to the mypy documentation, this is because cloudpathlib doesn't include type hints or declare itself as a PEP 561 compliant stub package.
Is cloudpathlib supposed to work with type checkers? I see that the code has type hints, so I'm surprised that it doesn't work for me out of the box.
It looks like it's as easy as adding an empty file called py.typed in the cloudpathlib directory, and adding package_data={"cloudpathlib": ["py.typed"]}) to setup.py. (See https://blog.whtsky.me/tech/2021/dont-forget-py.typed-for-your-typed-python-package/.)
Would you accept a PR that adds this?
Thanks for reporting! A PR is welcome.
@sid-kap This is released now in version 0.10.0 on PyPI
Awesome, thanks!!