Skip to content

Commit f79d774

Browse files
authored
Merge pull request #8 from eugo-inc/zarr-developers-main
Sync upstream
2 parents 07be494 + 3e3319c commit f79d774

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1645
-1166
lines changed

.github/workflows/ci.yaml

Lines changed: 23 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -13,94 +13,60 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
python-version: ["3.11", "3.12", "3.13"]
16-
# macos-13 is an intel runner, macos-14 is a arm64 runner
17-
platform: [ubuntu-latest, windows-latest, macos-13, macos-14]
16+
# macos-13 is an intel runner, macos-14 is an arm64 runner
17+
platform: [ubuntu-latest, ubuntu-22.04-arm, windows-latest, macos-13, macos-14]
18+
19+
defaults:
20+
run:
21+
shell: bash -el {0}
1822

1923
steps:
2024
- name: Checkout source
2125
uses: actions/checkout@v4
2226
with:
2327
submodules: recursive
28+
fetch-depth: 0 # required for version resolution
2429

2530
- name: Set up Conda
26-
uses: conda-incubator/[email protected].0
31+
uses: conda-incubator/[email protected].1
2732
with:
28-
channels: conda-forge
29-
miniforge-version: latest
30-
python-version: ${{ matrix.python-version }}
33+
channels: conda-forge
34+
miniforge-version: latest
35+
python-version: ${{ matrix.python-version }}
3136

32-
- name: Show info about `base` environment
33-
shell: "bash -l {0}"
34-
run: |
35-
conda info
36-
conda config --show-sources
37-
conda list --show-channel-urls
38-
39-
- name: Set up `env`
40-
shell: "bash -l {0}"
41-
run: >
42-
conda create -n env
43-
c-compiler cxx-compiler
44-
python=${{matrix.python-version}} wheel pip
37+
- name: Install compilers
38+
run: conda install -y c-compiler cxx-compiler
4539

4640
- name: Install clang
47-
shell: "bash -l {0}"
4841
if: matrix.platform == 'macos-13'
49-
run: |
50-
conda activate env
51-
conda install -y 'clang>=12.0.1,<17'
42+
run: conda install -y 'clang>=12.0.1,<17'
5243

53-
- name: Show info about `env` environment
54-
shell: "bash -l {0}"
44+
- name: Show conda environment info
5545
run: |
56-
conda list --show-channel-urls -n env
46+
conda info
47+
conda config --show-sources
48+
conda list --show-channel-urls
5749
5850
- name: Install numcodecs
59-
shell: "bash -l {0}"
6051
run: |
61-
conda activate env
6252
export DISABLE_NUMCODECS_AVX2=""
63-
# TODO: put back zfpy import when it supports numpy 2.0
64-
python -m pip install -v -e .[test,test_extras,msgpack,crc32c]
65-
66-
- name: Install pcodec
67-
if: matrix.python-version != '3.13'
68-
shell: "bash -l {0}"
69-
run: |
70-
conda activate env
71-
python -m pip install -v ".[pcodec]"
53+
python -m pip install -v -e .[test,test_extras,msgpack,crc32c,pcodec,zfpy]
7254
7355
- name: Install zarr-python
74-
shell: "bash -l {0}"
7556
# Since zarr v3 requires numpy >= 1.25, on Python 3.11 leave it out
7657
# so we can have some tests of our minimum version of numpy (1.24)
7758
if: matrix.python-version != '3.11'
78-
run: |
79-
conda activate env
80-
# TODO: remove --pre option when zarr v3 is out
81-
python -m pip install --pre zarr>=3.0.0b2
82-
83-
# This is used to test with zfpy, which does not yet support numpy 2.0
84-
- name: Install older numpy and zfpy
85-
if: matrix.python-version == '3.11'
86-
shell: "bash -l {0}"
87-
run: |
88-
conda activate env
89-
python -m pip install -v ".[zfpy]"
59+
run: python -m pip install zarr>=3
9060

9161
- name: List installed packages
92-
shell: "bash -l {0}"
93-
run: |
94-
conda activate env
95-
python -m pip list
62+
run: python -m pip list
9663

9764
- name: Run tests
9865
shell: "bash -l {0}"
99-
run: |
100-
conda activate env
101-
pytest -v
66+
run: pytest -v
10267

10368
- uses: codecov/codecov-action@v5
10469
with:
70+
fail_ci_if_error: true
10571
token: ${{ secrets.CODECOV_TOKEN }}
10672
verbose: true

.github/workflows/wheel.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
# macos-13 is an intel runner, macos-14 is a arm64 runner
17-
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
16+
# macos-13 is an intel runner, macos-14 is an arm64 runner
17+
os: [ubuntu-latest, ubuntu-22.04-arm, windows-latest, macos-13, macos-14]
1818
env:
1919
CIBW_TEST_COMMAND: python -c "import numcodecs"
2020
CIBW_BUILD: "cp311-* cp312-* cp313-*"
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
submodules: true
2828

29-
- uses: pypa/cibuildwheel@v2.21.3
29+
- uses: pypa/cibuildwheel@v2.23.2
3030

3131
- uses: actions/upload-artifact@v4
3232
with:

.pre-commit-config.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
exclude: ^fixture/ # files with trailing whitespaces on purpose
22
ci:
33
autoupdate_commit_msg: "chore: update pre-commit hooks"
4+
autoupdate_schedule: "monthly"
45
autofix_commit_msg: "style: pre-commit fixes"
56
autofix_prs: false
67
default_stages: [pre-commit, pre-push]
7-
default_language_version:
8-
python: python3
98
repos:
109
- repo: https://github.com/pre-commit/pre-commit-hooks
1110
rev: v5.0.0
@@ -15,20 +14,20 @@ repos:
1514
- id: debug-statements
1615

1716
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.7.4
17+
rev: v0.11.12
1918
hooks:
2019
- id: ruff
2120
args: ["--fix", "--show-fixes"]
2221
- id: ruff-format
2322

2423
- repo: https://github.com/scientific-python/cookie
25-
rev: 2024.08.19
24+
rev: 2025.05.02
2625
hooks:
2726
- id: sp-repo-review
2827

2928
- repo: https://github.com/pre-commit/mirrors-mypy
30-
rev: 'v1.13.0'
29+
rev: v1.16.0
3130
hooks:
3231
- id: mypy
3332
args: [--config-file, pyproject.toml]
34-
additional_dependencies: [numpy, pytest, crc32c, zfpy, 'zarr>=3.0.0b2']
33+
additional_dependencies: [numpy, pytest, crc32c, zfpy, 'zarr>=3']

adhoc/blosc_memleak_check.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import sys
22

3+
import numcodecs
34
import numpy as np
45
from numpy.testing import assert_array_equal
56

6-
import numcodecs
7-
87
codec = numcodecs.Blosc()
98
data = np.arange(int(sys.argv[1]))
109
for _ in range(int(sys.argv[2])):

docs/compression/blosc.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,9 @@ Blosc
1818
Helper functions
1919
----------------
2020

21-
.. autofunction:: init
22-
.. autofunction:: destroy
23-
.. autofunction:: compname_to_compcode
2421
.. autofunction:: list_compressors
2522
.. autofunction:: get_nthreads
2623
.. autofunction:: set_nthreads
27-
.. autofunction:: cbuffer_sizes
2824
.. autofunction:: cbuffer_complib
29-
.. autofunction:: cbuffer_metainfo
3025
.. autofunction:: compress
3126
.. autofunction:: decompress
32-
.. autofunction:: decompress_partial

docs/compression/zstd.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Zstd
77
.. autoattribute:: codec_id
88
.. automethod:: encode
99
.. automethod:: decode
10+
.. note::
11+
If the compressed data does not contain the decompressed size, streaming
12+
decompression will be used.
1013
.. automethod:: get_config
1114
.. automethod:: from_config
1215

docs/contributing.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,11 @@ contributors.
203203
Merging pull requests
204204
~~~~~~~~~~~~~~~~~~~~~
205205

206-
Pull requests submitted by an external contributor should be reviewed and approved by at least
207-
one core developers before being merged. Ideally, pull requests submitted by a core developer
208-
should be reviewed and approved by at least one other core developers before being merged.
206+
Pull requests should be reviewed and approved by at least one core developer
207+
(other than the pull request author) before being merged.
209208

210-
Pull requests should not be merged until all CI checks have passed (Travis, AppVeyor,
211-
Codecov) against code that has had the latest main merged in.
209+
Pull requests should not be merged until all CI checks have passed against code
210+
that has had the latest main merged in.
212211

213212
Compatibility and versioning policies
214213
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -278,6 +277,10 @@ hard-and-fast rules, e.g., it is fine to make a minor release to make a single n
278277
feature available; equally, it is fine to make a minor release that includes a number of
279278
changes.
280279

280+
When making a minor release, open an issue stating your intention so other developers
281+
know that a release is planned. At least a week's notice should be given for other
282+
developers to be aware of and possibly add to the contents of the release.
283+
281284
Major releases obviously need to be given careful consideration, and should be done as
282285
infrequently as possible, as they will break existing code and/or affect data
283286
compatibility in some way.

0 commit comments

Comments
 (0)