Skip to content

remove dependency upper bounds for numpy and matplotlib - #3499

Merged
C-Achard merged 11 commits into
cy/more-granular-canaryfrom
jaap/release-dependency-upper-bounds
Sep 14, 2026
Merged

C-Achard merged 11 commits into
cy/more-granular-canaryfrom
jaap/release-dependency-upper-bounds

Conversation

@deruyter92

@deruyter92 deruyter92 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

numpy and matplotlib had upper bounds because we used legacy patterns that are now deprecated. These are addressed in the PRs below, allowing us to remove the upper bounds. This allows for broader compatibility.

@deruyter92
deruyter92 added this pull request to stack #3500 September 9, 2026 09:16
@deruyter92
deruyter92 marked this pull request as ready for review September 9, 2026 09:19
@deruyter92 deruyter92 added dependencies Pull requests that update a dependency file 3.0.2 labels Sep 9, 2026
Base automatically changed from jaap/numpy-2-compatibility to dev September 9, 2026 12:46
@deruyter92
deruyter92 force-pushed the jaap/release-dependency-upper-bounds branch from c226368 to 71cc3bc Compare September 9, 2026 12:46
@deruyter92
deruyter92 requested a review from C-Achard September 9, 2026 12:46

@C-Achard C-Achard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep pandas pinned for now, matplotlib is definitely fine.
numpy is inherently more risky but I also agree that we should unpin.

@C-Achard

C-Achard commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

@deruyter92 Some additional findings

numpy lower bound and pickle

Once the <2 cap is gone, np-1 and np-2 might see some exchange of project files.
np2 can load pickle files created with np 1.26, and vice versa. For 1.25 and earlier loading np2 pickles will throw an exception.
See NumPy 2.0 migration guide.

We may want numpy<2 only for tf-cu11

From PyPI metadata for each pinned TF version:

extra tensorflow its own numpy specifier needs a DLC cap?
tf-cu11 ==2.14 numpy>=1.23.5no upper bound yes, the compile failure
tf-cu12 ==2.18 numpy<2.1.0,>=1.26.0 no — supports numpy 2.0 already
tf 2.122.17 2.15.1 <2.0.0,>=1.23.5; 2.16.1/2.17 <2.0.0 no
apple_mchips 2.122.17 same as above no

CI changes

Every full-suite job installs the [tf] extra so after merge, CI resolves numpy 1 everywhere. We may have to add more jobs.
The downloaded fixtures (tests/data/{dets,montblanc_*,trimouse_*}.pickle, montblanc_tracks.h5) were written under numpy 1 and are readable by numpy 2, so they work.

Removing both caps together is required

matplotlib 3.8.4 declares only numpy>=1.21, with no upper bound. So dropping numpy<2 while leaving matplotlib<3.9 would try to resolve matplotlib 3.8.4 + np2. Same risk for any compiled transitive dep that declares no numpy cap (pycocotools, tables, h5py, scikit-image), so an import smoke test under numpy 2 may be worth it.

numba

numba 0.54 requires numpy<1.21, which no DLC-supported numpy version satisfies. Per numba's support matrix, 0.60.0 is the first release supporting numpy 2.0 and the latest (0.67) supports 2.0 <= numpy < 2.6.
Should still play nice with TF opt deps I think.

TF specific (low priority)

np.lib.pad is still used at visualize.py:93 and vis_dataset.py:70. Unlikely to be a problem as we're not migrating TF to np2.

@deruyter92

deruyter92 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

We may want numpy<2 only for tf-cu11

@C-Achard agreed, just arrived at the same conclusion

@deruyter92

deruyter92 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

Every full-suite job installs the [tf] extra so after merge, CI resolves numpy 1 everywhere. We may have to add more jobs.

Instead, we should just remove the upperbound from tf right?

Edit: TF defines an upper bound themselves, which means that installing the tf extra naturally resolves to numpy 1.x for tensorflow versions up to 2.17

@deruyter92
deruyter92 removed this pull request from stack #3500 September 9, 2026 14:24
@deruyter92

Copy link
Copy Markdown
Collaborator Author

Let's keep an eye on the canary lane CI. Errors should surface here (softly).

@C-Achard

Copy link
Copy Markdown
Collaborator

Fixed numba + errors surfaced by the canary lane in #3508

@C-Achard

C-Achard commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

We should really decide whether this gets included now or later; I would include #3508 in 3.0.2 anyway but I think either:

but I don't think merging this as is right now is advisable.

Missing:

@C-Achard

Copy link
Copy Markdown
Collaborator

Note: fmpose3d also still pins numpy. See AdaptiveMotorControlLab/FMPose3D#36

@deruyter92
deruyter92 force-pushed the jaap/release-dependency-upper-bounds branch from 4ec23a6 to 9dc8f52 Compare September 14, 2026 08:50
@deruyter92
deruyter92 removed this pull request from stack #3507 September 14, 2026 08:51
@deruyter92
deruyter92 changed the base branch from dev to cy/fix-numpy2-unpin-issues September 14, 2026 08:52
@deruyter92
deruyter92 added this pull request to stack #3515 September 14, 2026 08:52
@deruyter92

Copy link
Copy Markdown
Collaborator Author

I don't think merging this as is right now is advisable
Of course, agreed. We won't merge this until CI is completely green. Assuming that our test-coverage is enough, I would say let's merge after our tests indicate we are ready. Any remaining compat issues from untested code can be easily addressed when they surface.

I think either:

Agreed. I would say we ship 3.0.2 ASAP in any case. If these PRs are fully resolved before the review + release is finished, we can include it. Otherwise we will ship in the next release.

Review comments below. @C-Achard agreed? Shall I address these myself?

Comment thread pyproject.toml
Comment thread .github/workflows/intelligent-testing.yml
@deruyter92
deruyter92 removed this pull request from stack #3515 September 14, 2026 11:38
@deruyter92
deruyter92 changed the base branch from cy/fix-numpy2-unpin-issues to cy/more-granular-canary September 14, 2026 11:40
deruyter92 and others added 10 commits September 14, 2026 13:43
Add the missing comma between the `matplotlib` and `numpy-1` matrix entries in `.github/workflows/intelligent-testing.yml` so the GitHub Actions matrix parses correctly.
Broaden the intelligent-testing workflow to include strict dependency-resolution checks for Python 3.10 and 3.12, plus NumPy 1/2 and Matplotlib upgrade variants. This improves compatibility coverage and validates resolver behavior beyond the previous narrower matrix.
Restore exclusion of matplotlib 3.7 and 3.7.1 from the base dependencies, and drop the redundant numpy cap from the `tf-cu12` extra because TensorFlow 2.18 already declares the required numpy range.
@deruyter92
deruyter92 force-pushed the jaap/release-dependency-upper-bounds branch from 9648bb1 to f010715 Compare September 14, 2026 11:44
@deruyter92
deruyter92 added this pull request to stack #3516 September 14, 2026 11:44
@C-Achard
C-Achard merged commit 0417ae2 into dev Sep 14, 2026
39 checks passed
@C-Achard
C-Achard deleted the jaap/release-dependency-upper-bounds branch September 14, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0.2 dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants