Skip to content

Fix dependency problems#55

Merged
rly merged 2 commits intorly:mainfrom
h-mayorquin:fix-min-requirements-numpy2
Feb 27, 2026
Merged

Fix dependency problems#55
rly merged 2 commits intorly:mainfrom
h-mayorquin:fix-min-requirements-numpy2

Conversation

@h-mayorquin
Copy link
Copy Markdown
Contributor

@h-mayorquin h-mayorquin commented Jan 21, 2026

This PR makes three changes:

1. Fix NumPy 2.0 compatibility by updating minimum dependencies

The problem manifests when a user installs ndx-pose on Python 3.10+ with the old minimum dependencies (pynwb==2.6.0, hdmf==3.13.0). Since pip resolves the newest compatible versions of transitive dependencies, it installs NumPy 2.0+ (released June 2024), which removed np.string_ in favor of np.bytes_. However, neither pynwb==2.6.0 nor hdmf==3.13.0 pin NumPy<2.0 or contain fixes for NumPy 2.0 compatibility - hdmf didn't add NumPy 2.0 support until version 4.0.0 (released January 2025). This causes a runtime AttributeError when reading/writing NWB files. The fix is to bump the minimum dependencies to hdmf>=4.0.0 and pynwb>=3.0.0 (the first pynwb compatible with hdmf 4.0+), ensuring any installation gets NumPy 2.0-compatible code.

2. Drop Python 3.8 and 3.9 support

Python 3.8 reached end-of-life in October 2024 and Python 3.9 reaches end-of-life in October 2025. This PR updates the minimum Python version to 3.10 and removes 3.8/3.9 from the CI test matrix.

3. Use PEP 735 dependency groups

Migrates from [project.optional-dependencies] to [dependency-groups] as specified in PEP 735.

@rly
Copy link
Copy Markdown
Owner

rly commented Feb 26, 2026

Thanks for the PR @h-mayorquin !

  1. Fix NumPy 2.0 compatibility by updating minimum dependencies

I looked into this and I don't think the dependency bump is necessary. If users want to use numpy 1.x with pynwb 2.6 and hdmf 3.13, they should be able to. If users want numpy 2.x, then later releases of pynwb/hdmf support that, and pip will resolve the latest compatible versions by default. I think we should be careful about unnecessarily raising lower bounds, which limits compatibility with other libraries users may need.

Instead of bumping up the minimum dependencies when we move the minimum tests to Python 3.10+, I suggest we add a numpy<2 pin to the min-reqs to keep the test valid.

@h-mayorquin
Copy link
Copy Markdown
Contributor Author

@rly Ok, take a look at the latest commit.

@rly
Copy link
Copy Markdown
Owner

rly commented Feb 27, 2026

That looks great. Thank you!

@rly rly merged commit a5e4c2e into rly:main Feb 27, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants