Consolidate dependencies into pyproject.toml; drop requirements*.txt#2205
Merged
Conversation
Adopt the hdmf dependency-management pattern: - Declare optional feature dependencies under [project.optional-dependencies] (termset, zarr, stream, all) and development dependencies under PEP 735 [dependency-groups] (test, docs) in pyproject.toml. - Remove requirements.txt, requirements-dev.txt, requirements-opt.txt, requirements-doc.txt, and requirements-min.txt. Keep environment-ros3.yml. - Rewrite tox.ini to install deps via extras/dependency_groups, with a single build env and uv --resolution lowest-direct for minimum-version testing. - Update CI workflows, .readthedocs.yaml, and developer docs to install via pyproject groups/extras (pip install --group ... ".[all]") instead of the requirements files. Convert the test matrices from -pinned to -upgraded. - Remove the obsolete update_requirements doc. Fixes #2204 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #2205 +/- ##
=======================================
Coverage 95.29% 95.29%
=======================================
Files 30 30
Lines 3038 3038
Branches 450 450
=======================================
Hits 2895 2895
Misses 87 87
Partials 56 56
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PyNWB did not previously expose pip extras, so drop the termset/zarr/stream/all [project.optional-dependencies] added in the prior commit. The optional feature dependencies now live in a dev-only `optional` dependency group (the former requirements-opt.txt content); the `docs` group includes it so the gallery examples still run. Update tox, CI, readthedocs, and docs to install via `--group optional` / `--group docs` instead of the `.[all]` extra. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The gallery-py310-minimum tox env installs with `uv --resolution lowest-direct`, which selected the oldest release on PyPI for every unpinned dependency. For `lxml` that was `1.3.2` (a Python-2-era release) which fails to build. Add lower bounds to the previously unbounded deps in the `optional` and `docs` dependency groups (lxml>=4.9.3, Pillow>=10, hdf5plugin>=4, pooch>=1.6, dataframe_image>=0.2.3, fsspec/requests/aiohttp/numcodecs) so the minimum environments resolve to sensible, installable versions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The dependency-consolidation rewrite renamed/removed tox envs, so update the release deploy workflow to use the test-py314-upgraded test env and the single build env. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The gallery-py310-minimum env applied `uv --resolution lowest-direct` to the docs/optional dependency groups, dragging oaklib down to 0.5.12, which uses the pydantic v1 `ModelMetaclass` API and fails to import against the pydantic v2 that gets resolved transitively. Install the docs and optional dependencies at their latest compatible versions first, then downgrade only pynwb's own direct dependencies to their minimum versions. This matches the previous behavior, where gallery-minimum installed requirements-min.txt (core, minimum) together with requirements-doc.txt (optional/docs, latest). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add `[project.optional-dependencies]` extras `zarr` (hdmf-zarr, zarr, numcodecs) and `termset` (linkml-runtime, schemasheets, oaklib) so users can `pip install pynwb[zarr]` / `pip install pynwb[termset]`. The extras are the single source for those feature dependencies. Replace the dev-only `optional` dependency group with a `stream` group (fsspec, requests, aiohttp) for the streaming tests; the docs group no longer includes it. tox installs the feature deps via `extras` factors and the gallery/optional/coverage/docs jobs install them with `".[zarr,termset]"`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
13 tasks
linkml and linkml-runtime 1.11 require click>=8.2, while dandi (a docs/gallery dependency) requires click<8.2. The gallery tox environment installs the termset extra and the docs group in separate `pip install -U` transactions, so the termset transaction force-upgrades click to 8.4.2 and breaks dandi, failing the `pip check` step before the gallery examples run. Capping both packages keeps click at 8.1.x, which satisfies every package in the stack. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
The latest dandi and linkml-runtime cannot be installed together currently. dandi requires |
oruebel
approved these changes
Jun 26, 2026
This was referenced Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Fixes #2204. Adopts the hdmf dependency-management pattern: all dependency declarations live in
pyproject.toml, and therequirements*.txtfiles are removed.Changes
pyproject.toml: added[project.optional-dependencies](termset,zarr,stream, and anallaggregate) and PEP 735[dependency-groups](test,docs).requirements.txt,requirements-dev.txt,requirements-opt.txt,requirements-doc.txt,requirements-min.txt. Keptenvironment-ros3.yml(conda/ROS3 jobs).tox.ini: rewritten to install viaextras/dependency_groups; a singlebuildenv;upgraded/prereleaseusepip install -U/-U --pre;minimumenvs useuv pip install --resolution lowest-direct(replacesrequirements-min.txt).toxand runtox -e <env>; ros3/coverage/sphinx jobs now install viapip install --group <group> ".[all]". Converted the test matrices from-pinnedto-upgradedand to the singlebuildenv..readthedocs.yaml: installs--group docs ".[all]".install_developers.rst(pip install --group test -e ".[all]"),software_process.rst,make_a_release.rst, and the release PR template; removed the obsoleteupdate_requirements.rst.termsetextra: cappedlinkmlandlinkml-runtimebelow1.11. Those versions requireclick>=8.2, whiledandi(a docs/gallery dependency) requiresclick<8.2. The gallery tox env installs the termset extra and the docs group in separatepip install -Utransactions, so an uncapped termset transaction force-upgradesclickto a version that breaksdandi, failing thepip checkstep. The cap keepsclickat8.1.x, which satisfies the whole stack.Validation
pyproject.tomlparses; optional-dependencies and dependency-groups resolve.toxconfig resolves for all environment types (validated withtox config -e <env>using tox 4.55 + uv in an isolated venv). Theminimumenvs share hdmf's knowntox configintrospection quirk but run normally viatox -e..readthedocs.yamlvalidate.clickcap was verified by reproducing the gallery env's two-stagepip install -Usequence (docs group, then termset extra): with both caps in place the stack resolves toclick 8.1.8andpip checkpasses.Notes / needs CI
uv --resolution lowest-directminimum builds, and thepip install --groupcommands (requires pip ≥ 25.1, present on the runners).testgroup dropsblack/isort(ruff supersedes them). Optional-dependency version floors mirror hdmf where applicable.linkml/linkml-runtime<1.11cap is a workaround for an upstreamclickconstraint disagreement betweendandiandlinkml. It can be lifted oncedandirelaxes itsclick<8.2bound orlinkmlregainsclick<8.2compatibility.🤖 Generated with Claude Code