Declare typing support via `py.typed` file
Running mypy on code that uses the latest version of zarr fails with the error message "module is installed, but missing library stubs or py.typed marker". A quick look at zarr'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 zarr.
To resolve this, please do the following:
- [ ] If not already, ensure that all public items in
zarrare type-annotated and validated by mypy. - [ ] Add an empty file named
py.typedinside thezarr/package. - [ ] Ensure that the
zarr/py.typedfile is included in sdists & wheels built from the project. This may involve configuration specific to your build backend (setuptools) that is beyond the scope of this comment.- You can list the contents of an sdist (the
dist/zarr-{version}.tar.gzfile created when building the project) by runningtar ztf dist/zarr-{version}.tar.gzon it. - You can list the contents of a wheel (a
dist/zarr-{version}-*-*-*.whlfile created when building the project) by runningzipinfo -1 dist/zarr-{version}-*-*-*.whlon it.
- You can list the contents of an sdist (the
Further references:
@jwodder - thanks for opening this issue. It is perfectly aligned with what we're looking to provide in v3.
That said, I think we should wait to do this work until we're a little further along (i.e. https://github.com/zarr-developers/zarr-python/issues/1593 👈 help wanted!).
@dstansby - wondering if you can take this one on as part of #1783.
👍