Skip to content

Commit 196a830

Browse files
PEP 735: optional-dependencies → dependency-groups
This way test dependencies won't appear as runtime dependencies in PiPy: https://pypi.org/project/numcodecs/
1 parent fa92ee7 commit 196a830

4 files changed

Lines changed: 36 additions & 23 deletions

File tree

.github/workflows/ci-i386.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Install zfp and numcodecs
4949
run: |
5050
uv venv
51-
uv pip install --group dev
51+
uv pip install --group dev --group test --group test-extras
5252
PYTHON_INCLUDE=$(uv run python -c 'from sysconfig import get_paths; print(get_paths()["include"])');
5353
PYTHON_LIB=$(uv run python -c 'import sysconfig; print(sysconfig.get_config_var("LIBDIR"))');
5454
git clone https://github.com/LLNL/zfp
@@ -59,7 +59,7 @@ jobs:
5959
uv run sudo make -C zfp/build install
6060
uv pip install ./zfp
6161
uv pip install --no-build-isolation -v .
62-
uv pip install "numcodecs[test,test_extras,msgpack,google_crc32c,crc32c,zfpy]"
62+
uv pip install "numcodecs[msgpack,google_crc32c,crc32c,zfpy]"
6363
shell: alpine.sh {0}
6464

6565
- name: List installed packages

.github/workflows/ci.yaml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@ jobs:
3737
run: |
3838
# TODO: Remove this conditional when pcodec supports Python 3.14
3939
if [[ "${{ matrix.python-version }}" == "3.14" ]]; then
40-
python -m pip install -v ".[test,test_extras,msgpack,google_crc32c,crc32c,zfpy]"
40+
python -m pip install -v \
41+
--group test --group test_extras \
42+
".[msgpack,google_crc32c,crc32c,zfpy]"
4143
else
42-
python -m pip install -v ".[test,test_extras,msgpack,google_crc32c,crc32c,pcodec,zfpy]"
44+
python -m pip install -v \
45+
--group test --group test_extras \
46+
".[msgpack,google_crc32c,crc32c,pcodec,zfpy]"
4347
fi
4448
4549
- name: List installed packages
@@ -85,12 +89,15 @@ jobs:
8589
python-version: ${{ matrix.python-version }}
8690
cache: 'pip'
8791

92+
- name: Upgrade pip
93+
run: python -m pip install --upgrade pip
94+
8895
- name: Install numcodecs
8996
run: |
9097
if [[ -n "${{ matrix.extras }}" ]]; then
91-
python -m pip install -v ".[${{ matrix.extras }},test]"
98+
python -m pip install -v --group test ".[${{ matrix.extras }}]"
9299
else
93-
python -m pip install -v ".[test]"
100+
python -m pip install -v --group test .
94101
fi
95102
96103
- name: List installed packages
@@ -135,9 +142,15 @@ jobs:
135142
python-version: ${{ matrix.python-version }}
136143
cache: 'pip'
137144

145+
- name: Upgrade pip
146+
run: python -m pip install --upgrade pip
147+
138148
- name: Install numcodecs and Zarr
139149
run: |
140-
python -m pip install -v ".[test,test_extras]" "${{ matrix.zarr-pkg }}" crc32c
150+
python -m pip install -v \
151+
--group test --group test_extras \
152+
. "${{ matrix.zarr-pkg }}" crc32c
153+
141154
- name: List installed packages
142155
run: python -m pip list
143156

docs/contributing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ bootstrap the build dependencies, then install numcodecs in editable mode:
116116

117117
```
118118
$ uv venv
119-
$ uv pip install --group dev
120-
$ uv pip install --no-build-isolation -e ".[test,test_extras,msgpack]"
119+
$ uv pip install --group dev --group test --group test_extras
120+
$ uv pip install --no-build-isolation -e ".[msgpack]"
121121
```
122122

123123
The first ``uv pip install`` step bootstraps the build tools into the virtualenv.
@@ -141,8 +141,8 @@ $ python -m venv venv
141141
$ source venv/bin/activate # macOS/Linux
142142
$ # .\venv\Scripts\activate # Windows
143143

144-
$ pip install --group dev
145-
$ pip install --no-build-isolation -e ".[test,test_extras,msgpack]"
144+
$ pip install --group dev --group test --group test_extras
145+
$ pip install --no-build-isolation -e ".[msgpack]"
146146
$ pytest -v
147147
```
148148

pyproject.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ crc32c = [
6262
google_crc32c = [
6363
"google-crc32c>=1.5"
6464
]
65+
66+
[dependency-groups]
67+
dev = [
68+
"meson-python>=0.17",
69+
"meson>=1.6.0",
70+
"ninja",
71+
"cython>=3.0",
72+
"setuptools-scm>=6.2",
73+
"numpy>=2",
74+
]
6575
docs = [
6676
"sphinx",
6777
"sphinx-issues",
@@ -79,16 +89,6 @@ test_extras = [
7989
"importlib_metadata",
8090
"crc32c", # TODO: remove once zarr-python does not depend on crc32c anymore
8191
]
82-
83-
[dependency-groups]
84-
dev = [
85-
"meson-python>=0.17",
86-
"meson>=1.6.0",
87-
"ninja",
88-
"cython>=3.0",
89-
"setuptools-scm>=6.2",
90-
"numpy>=2",
91-
]
9292
test-zarr-308 = [
9393
"pytest",
9494
"pytest-cov",
@@ -243,8 +243,8 @@ warn_unused_configs = true
243243
# meson-python editable installs require build deps (ninja, meson) at runtime for
244244
# auto-rebuild on import. Skip build isolation so the venv's ninja is used.
245245
# The "dev" dependency group provides these build tools. Bootstrap with:
246-
# `uv pip install --group dev` before running
247-
# `uv pip install --no-build-isolation -e ".[test,test_extras,msgpack]"`.
246+
# `uv pip install --group dev --group test --group test_extras` before running
247+
# `uv pip install --no-build-isolation -e ".[msgpack]"`.
248248
no-build-isolation-package = ["numcodecs"]
249249
conflicts = [
250250
# Zarr versions conflict with each other

0 commit comments

Comments
 (0)