Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare typing support via py.typed file #1566

Open
3 tasks
jwodder opened this issue Nov 7, 2023 · 3 comments
Open
3 tasks

Declare typing support via py.typed file #1566

jwodder opened this issue Nov 7, 2023 · 3 comments
Labels
help wanted Issue could use help from someone with familiarity on the topic types V3 Related to compatibility with V3 spec
Milestone

Comments

@jwodder
Copy link

jwodder commented Nov 7, 2023

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 zarr are type-annotated and validated by mypy.
  • Add an empty file named py.typed inside the zarr/ package.
  • Ensure that the zarr/py.typed file 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.gz file created when building the project) by running tar ztf dist/zarr-{version}.tar.gz on it.
    • You can list the contents of a wheel (a dist/zarr-{version}-*-*-*.whl file created when building the project) by running zipinfo -1 dist/zarr-{version}-*-*-*.whl on it.

Further references:

@jhamman jhamman added V3 Related to compatibility with V3 spec help wanted Issue could use help from someone with familiarity on the topic types labels Dec 7, 2023
@jhamman
Copy link
Member

jhamman commented Dec 7, 2023

@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. #1593 👈 help wanted!).

@jhamman
Copy link
Member

jhamman commented May 7, 2024

@dstansby - wondering if you can take this one on as part of #1783.

@dstansby
Copy link
Contributor

dstansby commented May 7, 2024

👍

@jhamman jhamman modified the milestones: 3.0.0.alpha, 3.0.0 May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue could use help from someone with familiarity on the topic types V3 Related to compatibility with V3 spec
Projects
Status: Todo
Development

No branches or pull requests

3 participants