Skip to content

Disallow implicit re-exports #1908

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

Merged
merged 3 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -201,48 +201,43 @@ disallow_incomplete_defs = true
disallow_untyped_calls = true

disallow_untyped_defs = true
no_implicit_reexport = true


[[tool.mypy.overrides]]
module = [
"zarr.v2.*",
"zarr.group",
"tests.*",
]
check_untyped_defs = false
ignore_errors = true

[[tool.mypy.overrides]]
module = [
"zarr.v2.*",
"zarr.array_v2",
"zarr.group",
"tests.*",
]
disallow_any_generics = false
check_untyped_defs = false

[[tool.mypy.overrides]]
module = [
"zarr.v2.*",
"zarr.array_v2",
"zarr.group"
]
disallow_incomplete_defs = false

[[tool.mypy.overrides]]
module = [
"zarr.v2.*",
"zarr.array_v2",
"zarr.array",
"zarr.buffer"
]
disallow_untyped_calls = false

[[tool.mypy.overrides]]
module = [
"zarr.v2.*",
"zarr.array_v2",
"zarr.array",
"zarr.group",
]
disallow_untyped_defs = false


[tool.pytest.ini_options]
minversion = "7"
testpaths = ["tests"]
Expand Down
4 changes: 2 additions & 2 deletions src/zarr/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
ZarrFormat,
concurrent_map,
)
from zarr.config import config
from zarr.config import config, parse_indexing_order
from zarr.indexing import BasicIndexer
from zarr.metadata import ArrayMetadata, ArrayV2Metadata, ArrayV3Metadata, parse_indexing_order
from zarr.metadata import ArrayMetadata, ArrayV2Metadata, ArrayV3Metadata
from zarr.store import StoreLike, StorePath, make_store_path
from zarr.sync import sync

Expand Down
31 changes: 23 additions & 8 deletions src/zarr/codecs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
from __future__ import annotations

from zarr.codecs.blosc import BloscCname, BloscCodec, BloscShuffle # noqa: F401
from zarr.codecs.bytes import BytesCodec, Endian # noqa: F401
from zarr.codecs.crc32c_ import Crc32cCodec # noqa: F401
from zarr.codecs.gzip import GzipCodec # noqa: F401
from zarr.codecs.pipeline import BatchedCodecPipeline # noqa: F401
from zarr.codecs.sharding import ShardingCodec, ShardingCodecIndexLocation # noqa: F401
from zarr.codecs.transpose import TransposeCodec # noqa: F401
from zarr.codecs.zstd import ZstdCodec # noqa: F401
from zarr.codecs.blosc import BloscCname, BloscCodec, BloscShuffle
from zarr.codecs.bytes import BytesCodec, Endian
from zarr.codecs.crc32c_ import Crc32cCodec
from zarr.codecs.gzip import GzipCodec
from zarr.codecs.pipeline import BatchedCodecPipeline
from zarr.codecs.sharding import ShardingCodec, ShardingCodecIndexLocation
from zarr.codecs.transpose import TransposeCodec
from zarr.codecs.zstd import ZstdCodec

__all__ = [
"BatchedCodecPipeline",
"BloscCodec",
"BloscCname",
"BloscShuffle",
"BytesCodec",
"Endian",
"Crc32cCodec",
"GzipCodec",
"ShardingCodec",
"ShardingCodecIndexLocation",
"TransposeCodec",
"ZstdCodec",
]
3 changes: 1 addition & 2 deletions src/zarr/codecs/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
ArrayBytesCodec,
ArrayBytesCodecPartialDecodeMixin,
ArrayBytesCodecPartialEncodeMixin,
ByteGetter,
BytesBytesCodec,
ByteSetter,
Codec,
CodecPipeline,
)
from zarr.abc.store import ByteGetter, ByteSetter
from zarr.buffer import Buffer, NDBuffer
from zarr.codecs.registry import get_codec_class
from zarr.common import JSON, concurrent_map, parse_named_configuration
Expand Down
3 changes: 1 addition & 2 deletions src/zarr/codecs/sharding.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
ArrayBytesCodec,
ArrayBytesCodecPartialDecodeMixin,
ArrayBytesCodecPartialEncodeMixin,
ByteGetter,
ByteSetter,
Codec,
CodecPipeline,
)
from zarr.abc.store import ByteGetter, ByteSetter
from zarr.buffer import Buffer, NDBuffer
from zarr.chunk_grids import RegularChunkGrid
from zarr.codecs.bytes import BytesCodec
Expand Down
3 changes: 3 additions & 0 deletions src/zarr/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
_bool = bool


__all__ = ["ArrayMetadata"]


class DataType(Enum):
bool = "bool"
int8 = "int8"
Expand Down
2 changes: 2 additions & 0 deletions src/zarr/store/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
from zarr.store.remote import RemoteStore
from zarr.store.local import LocalStore
from zarr.store.memory import MemoryStore

__all__ = ["StorePath", "StoreLike", "make_store_path", "RemoteStore", "LocalStore", "MemoryStore"]
Loading