Skip to content

Commit 8b882dc

Browse files
maxrjonesQuLogic
andauthored
Migrate build system from setuptools to meson-python (#826)
* Migrate build system from setuptools to meson-python * Bootstrap first * Combine installs * Drop pixi * Seperate args * fix for windows * Fix bootstrap * Don't include pcodec on i386 * Update docs/contributing.rst Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> * Remove unnecessary split * Remove unnecessary flag * Cleanup gitignore * More accurate release notes * Use dev group * Fix contrib instructions * Remove pixi section * Test backwards compatibility shim * Test different crc32c branches * Keep old job name * Lint * Collect coverage on all test jobs * Non-editable install * Fix coverage setting * Remove job name to match repo requirements --------- Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 parent 06a53c6 commit 8b882dc

Some content is hidden

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

77 files changed

+1341
-557
lines changed

.github/workflows/ci-i386.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ jobs:
4545
py3-pip
4646
py3-pytest
4747
48-
- name: Install zfp
48+
- name: Install zfp and numcodecs
4949
run: |
5050
uv venv
51+
uv pip install --group dev
5152
PYTHON_INCLUDE=$(uv run python -c 'from sysconfig import get_paths; print(get_paths()["include"])');
5253
PYTHON_LIB=$(uv run python -c 'import sysconfig; print(sysconfig.get_config_var("LIBDIR"))');
5354
git clone https://github.com/LLNL/zfp
@@ -56,19 +57,9 @@ jobs:
5657
uv run cmake zfp -B zfp/build -DBUILD_ZFPY=ON -DBUILD_TESTING=OFF -DPYTHON_LIBRARY=$PYTHON_LIB -DPYTHON_INCLUDE_DIR=$PYTHON_INCLUDE
5758
uv run make -j -C zfp/build
5859
uv run sudo make -C zfp/build install
59-
uv add "zfpy @ ./zfp"
60-
shell: alpine.sh {0}
61-
62-
- name: Install numcodecs
63-
run: |
64-
export DISABLE_NUMCODECS_AVX2=""
65-
uv venv
66-
# TODO: Remove this conditional when pcodec supports Python 3.14
67-
if [[ "${{ matrix.python-version }}" == "3.14" ]]; then
68-
uv pip install -v -e .[test,test_extras,msgpack,google_crc32c,crc32c,zfpy]
69-
else
70-
uv pip install -v -e .[test,test_extras,msgpack,google_crc32c,crc32c,pcodec,zfpy]
71-
fi
60+
uv pip install ./zfp
61+
uv pip install --no-build-isolation -v .
62+
uv pip install "numcodecs[test,test_extras,msgpack,google_crc32c,crc32c,zfpy]"
7263
shell: alpine.sh {0}
7364

7465
- name: List installed packages

.github/workflows/ci.yaml

Lines changed: 77 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,11 @@ jobs:
4949
5050
- name: Install numcodecs
5151
run: |
52-
export DISABLE_NUMCODECS_AVX2=""
5352
# TODO: Remove this conditional when pcodec supports Python 3.14
5453
if [[ "${{ matrix.python-version }}" == "3.14" ]]; then
55-
python -m pip install -v -e .[test,test_extras,msgpack,google_crc32c,crc32c,zfpy]
54+
python -m pip install -v ".[test,test_extras,msgpack,google_crc32c,crc32c,zfpy]"
5655
else
57-
python -m pip install -v -e .[test,test_extras,msgpack,google_crc32c,crc32c,pcodec,zfpy]
56+
python -m pip install -v ".[test,test_extras,msgpack,google_crc32c,crc32c,pcodec,zfpy]"
5857
fi
5958
6059
- name: List installed packages
@@ -70,12 +69,72 @@ jobs:
7069
token: ${{ secrets.CODECOV_TOKEN }}
7170
verbose: true
7271

72+
test-crc32c:
73+
runs-on: ubuntu-latest
74+
strategy:
75+
fail-fast: false
76+
matrix:
77+
include:
78+
- name: google-crc32c
79+
extras: "google_crc32c"
80+
- name: crc32c
81+
extras: "crc32c"
82+
- name: no-crc32c
83+
extras: ""
84+
85+
defaults:
86+
run:
87+
shell: bash -el {0}
88+
89+
steps:
90+
- name: Checkout source
91+
uses: actions/checkout@v5
92+
with:
93+
submodules: recursive
94+
fetch-depth: 0
95+
96+
- name: Set up Conda
97+
uses: conda-incubator/setup-miniconda@v3.2.0
98+
with:
99+
channels: conda-forge
100+
miniforge-version: latest
101+
python-version: "3.13"
102+
103+
- name: Install compilers
104+
run: conda install -y c-compiler cxx-compiler
105+
106+
- name: Install numcodecs
107+
run: |
108+
if [[ -n "${{ matrix.extras }}" ]]; then
109+
python -m pip install -v ".[${{ matrix.extras }},test]"
110+
else
111+
python -m pip install -v ".[test]"
112+
fi
113+
114+
- name: List installed packages
115+
run: python -m pip list
116+
117+
- name: Run checksum tests
118+
run: pytest -v tests/test_checksum32.py
119+
120+
- uses: codecov/codecov-action@v5
121+
with:
122+
fail_ci_if_error: true
123+
token: ${{ secrets.CODECOV_TOKEN }}
124+
verbose: true
125+
73126
test-zarr:
74127
runs-on: ubuntu-latest
75128
strategy:
76129
fail-fast: false
77130
matrix:
78-
zarr-version: ["312", "313", "main"]
131+
include:
132+
- zarr-version: "312"
133+
zarr-pkg: "zarr==3.1.2"
134+
- zarr-version: "313"
135+
zarr-pkg: "zarr==3.1.3"
136+
- zarr-version: "main"
137+
zarr-pkg: "zarr @ git+https://github.com/zarr-developers/zarr-python.git@main"
79138

80139
defaults:
81140
run:
@@ -88,19 +147,24 @@ jobs:
88147
submodules: recursive
89148
fetch-depth: 0 # required for version resolution
90149

91-
- name: Set up Pixi
92-
uses: prefix-dev/setup-pixi@v0.9.0
150+
- name: Set up Conda
151+
uses: conda-incubator/setup-miniconda@v3.2.0
93152
with:
94-
pixi-version: v0.49.0
95-
cache: false
153+
channels: conda-forge
154+
miniforge-version: latest
155+
python-version: "3.13"
156+
157+
- name: Install compilers
158+
run: conda install -y c-compiler cxx-compiler
96159

160+
- name: Install numcodecs and Zarr
161+
run: |
162+
python -m pip install -v ".[test,test_extras]" "${{ matrix.zarr-pkg }}" crc32c
97163
- name: List installed packages
98-
shell: "bash -l {0}"
99-
run: pixi run ls-deps-${{matrix.zarr-version}}
164+
run: python -m pip list
100165

101-
- name: Run tests with Zarr ${{ matrix.zarr-version }}
102-
shell: "bash -l {0}"
103-
run: pixi run test-zarr-${{ matrix.zarr-version }}
166+
- name: Run Zarr integration tests
167+
run: pytest tests/test_zarr3.py tests/test_zarr3_import.py
104168

105169
- uses: codecov/codecov-action@v5
106170
with:

.github/workflows/wheel.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
CIBW_TEST_COMMAND: python -c "import numcodecs"
2626
CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-*"
2727
CIBW_SKIP: "*-musllinux_* *win32 *_i686 *_s390x"
28-
# note: CIBW_ENVIRONMENT is now set in pyproject.toml
28+
# note: cibuildwheel config-settings are set in pyproject.toml
2929

3030
steps:
3131
- uses: actions/checkout@v5

.gitignore

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ __pycache__/
33
*.py[cod]
44
*$py.class
55

6-
# C extensions
7-
numcodecs/**/*.c
8-
numcodecs/**/*.h
6+
# Shared libraries (legacy, meson builds out-of-source)
97
*.so
108

119
# editor
@@ -50,8 +48,6 @@ coverage.xml
5048
.hypothesis/
5149
cover/
5250

53-
# Cython annotation files
54-
numcodecs/*.html
5551

5652
# Translations
5753
*.mo
@@ -99,12 +95,8 @@ ENV/
9995
# PyCharm
10096
.idea
10197

102-
# setuptools-scm
103-
numcodecs/version.py
104-
105-
# Cython generated
106-
numcodecs/*.c
10798
# pixi environments
10899
.pixi/*
109100
*.egg-info
110-
pixi.lock
101+
pixi.lock
102+
uv.lock

MANIFEST.in

Lines changed: 0 additions & 3 deletions
This file was deleted.

adhoc/blosc_memleak_check.py

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

3-
import numcodecs
43
import numpy as np
54
from numpy.testing import assert_array_equal
65

6+
import numcodecs
7+
78
codec = numcodecs.Blosc()
89
data = np.arange(int(sys.argv[1]))
910
for _ in range(int(sys.argv[2])):

0 commit comments

Comments
 (0)