From ff6215fce383af2a87cb62f116791a7c285bbc29 Mon Sep 17 00:00:00 2001 From: Andrey Aristov Date: Sun, 28 Dec 2025 02:42:25 +0100 Subject: [PATCH 1/3] upgrade for zarr v3 API --- .gitignore | 3 ++- setup.cfg | 2 +- src/zarr_tools/convert.py | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 275b1b8..73b42e0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ _version.py .tox venv build -.coverage \ No newline at end of file +.coverage +*.zarr/ diff --git a/setup.cfg b/setup.cfg index a40e89c..70a94af 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,7 +27,7 @@ install_requires = dask fire nd2 - zarr>=2.4,<3 + zarr>=3.0 python_requires = >=3.10 include_package_data = True package_dir = diff --git a/src/zarr_tools/convert.py b/src/zarr_tools/convert.py index 90d79bf..7f7f6c5 100644 --- a/src/zarr_tools/convert.py +++ b/src/zarr_tools/convert.py @@ -6,6 +6,7 @@ import dask.array as da import zarr +from zarr.storage import LocalStore def to_zarr( @@ -19,8 +20,9 @@ def to_zarr( """ Saves multiscale zarr dataset, returns the path.zarr """ - store = zarr.DirectoryStore(baseurl := path) - grp = zarr.group(store) + baseurl = path + store = LocalStore(baseurl) + grp = zarr.open_group(store, mode="a") print(baseurl) datasets = [] From 392a71f1c9102196f32559af328302f376f11162 Mon Sep 17 00:00:00 2001 From: Andrey Aristov Date: Sun, 28 Dec 2025 02:54:35 +0100 Subject: [PATCH 2/3] python min version 3.11 --- .github/workflows/python-package.yml | 2 +- .pre-commit-config.yaml | 3 ++- setup.cfg | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 58baa42..1d43ae9 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: platform: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.11', '3.12'] steps: - uses: actions/checkout@v2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e71127c..b58577e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,6 +9,7 @@ repos: rev: v3.2.0 hooks: - id: setup-cfg-fmt + args: [--min-py-version, "3.11"] - repo: https://github.com/PyCQA/flake8 rev: 7.3.0 hooks: @@ -33,7 +34,7 @@ repos: rev: v3.21.2 hooks: - id: pyupgrade - args: [--py38-plus, --keep-runtime-typing] + args: [--py311-plus, --keep-runtime-typing] # - repo: https://github.com/tlambert03/napari-plugin-checks # rev: v0.2.0 # hooks: diff --git a/setup.cfg b/setup.cfg index 70a94af..c7077cf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,7 +28,7 @@ install_requires = fire nd2 zarr>=3.0 -python_requires = >=3.10 +python_requires = >=3.11 include_package_data = True package_dir = =src From e67199c615a1982f92470b0ae59915d29fe3aea7 Mon Sep 17 00:00:00 2001 From: Andrey Aristov Date: Sun, 28 Dec 2025 03:05:21 +0100 Subject: [PATCH 3/3] update actions --- .github/workflows/python-package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 1d43ae9..5d199f5 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -24,10 +24,10 @@ jobs: python-version: ['3.11', '3.12'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -57,9 +57,9 @@ jobs: runs-on: ubuntu-latest if: contains(github.ref, 'tags') steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: "3.x" - name: Install dependencies