Skip to content

Commit 56d45f9

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 1fdde70 commit 56d45f9

File tree

4 files changed

+29
-23
lines changed

4 files changed

+29
-23
lines changed

.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: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ jobs:
5151
run: |
5252
# TODO: Remove this conditional when pcodec supports Python 3.14
5353
if [[ "${{ matrix.python-version }}" == "3.14" ]]; then
54-
python -m pip install -v ".[test,test_extras,msgpack,google_crc32c,crc32c,zfpy]"
54+
python -m pip install -v \
55+
--group test --group test_extras \
56+
".[msgpack,google_crc32c,crc32c,zfpy]"
5557
else
56-
python -m pip install -v ".[test,test_extras,msgpack,google_crc32c,crc32c,pcodec,zfpy]"
58+
python -m pip install -v \
59+
--group test --group test_extras \
60+
".[msgpack,google_crc32c,crc32c,pcodec,zfpy]"
5761
fi
5862
5963
- name: List installed packages
@@ -106,9 +110,9 @@ jobs:
106110
- name: Install numcodecs
107111
run: |
108112
if [[ -n "${{ matrix.extras }}" ]]; then
109-
python -m pip install -v ".[${{ matrix.extras }},test]"
113+
python -m pip install -v --group test ".[${{ matrix.extras }}]"
110114
else
111-
python -m pip install -v ".[test]"
115+
python -m pip install -v --group test .
112116
fi
113117
114118
- name: List installed packages
@@ -159,7 +163,9 @@ jobs:
159163

160164
- name: Install numcodecs and Zarr
161165
run: |
162-
python -m pip install -v ".[test,test_extras]" "${{ matrix.zarr-pkg }}" crc32c
166+
python -m pip install -v \
167+
--group test --group test_extras \
168+
. "${{ matrix.zarr-pkg }}" crc32c
163169
- name: List installed packages
164170
run: python -m pip list
165171

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)