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

Update for zarr_checksum 0.2.12 #1365

Merged
merged 1 commit into from
Nov 27, 2023
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
5 changes: 1 addition & 4 deletions dandi/files/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from dandischema.digests.zarr import get_checksum
from dandischema.models import BareAsset, DigestType
import requests
from zarr_checksum.tree import ZarrChecksumTree

from dandi import get_logger
from dandi.consts import (
Expand Down Expand Up @@ -287,10 +288,6 @@ def iter_upload(
``"done"`` and an ``"asset"`` key containing the resulting
`RemoteAsset`.
"""
# Importing zarr_checksum leads to importing numpy, which we want to
# avoid unless necessary
from zarr_checksum import ZarrChecksumTree

# So that older clients don't get away with doing the wrong thing once
# Zarr upload to embargoed Dandisets is implemented in the API:
if dandiset.embargo_status is EmbargoStatus.EMBARGOED:
Expand Down
5 changes: 1 addition & 4 deletions dandi/support/digests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

from dandischema.digests.dandietag import DandiETag
from fscacher import PersistentCache
from zarr_checksum.tree import ZarrChecksumTree

from .threaded_walk import threaded_walk
from ..utils import Hasher, exclude_from_zarr
Expand Down Expand Up @@ -104,10 +105,6 @@ def get_zarr_checksum(path: Path, known: dict[str, str] | None = None) -> str:
passed in the ``known`` argument, which must be a `dict` mapping
slash-separated paths relative to the root of the Zarr to hex digests.
"""
# Importing zarr_checksum leads to importing numpy, which we want to avoid
# unless necessary
from zarr_checksum import ZarrChecksumTree

if path.is_file():
s = get_digest(path, "md5")
assert isinstance(s, str)
Expand Down
6 changes: 1 addition & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ install_requires =
semantic-version
tenacity
zarr ~= 2.10
zarr_checksum
zarr_checksum ~= 0.2.12
zip_safe = False
packages = find_namespace:
include_package_data = True
Expand Down Expand Up @@ -216,10 +216,6 @@ ignore_missing_imports = True
# <https://github.com/zarr-developers/zarr-python/issues/1566>
ignore_missing_imports = True

[mypy-zarr_checksum.*]
# <https://github.com/dandi/zarr_checksum/issues/5>
ignore_missing_imports = True

[pydantic-mypy]
init_forbid_extra = True
warn_untypes_fields = True