fix(dev): cap numpy<2.5 in dev extra to unblock mypy typecheck#499
Open
davidnichols-ops wants to merge 1 commit into
Open
fix(dev): cap numpy<2.5 in dev extra to unblock mypy typecheck#499davidnichols-ops wants to merge 1 commit into
davidnichols-ops wants to merge 1 commit into
Conversation
numpy 2.5.0 (2026-06-21) ships type stubs using PEP 695 `type` statement syntax, which mypy cannot parse under python_version = "3.10". With no upper bound on numpy, `pip install ".[dev]"` pulls 2.5.0 and the `mypy roboflow` CI step fails across the entire 3.10–3.13 matrix. Cap numpy<2.5 in the dev extra only. pip intersects this with the runtime requirement (numpy>=1.18.5), so dev/typecheck installs get >=1.18.5,<2.5 while end-user runtime installs stay unconstrained. Fixes roboflow#498
89fca4d to
95b3f55
Compare
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.
Summary
typestatement syntax, which mypy cannot parse underpython_version = "3.10"(set inpyproject.toml).pip install ".[dev]"now resolves numpy 2.5.0, and themypy roboflowstep inmake check_code_quality(run in CI via.github/workflows/test.yml) fails across the entire 3.10–3.13 matrix.typestatements, incompatible withmypy python_version = "3.10"#498 for the full diagnosis.numpy<2.5in thedevextra insetup.pyonly. pip intersects this with the runtime requirement (numpy>=1.18.5inrequirements.txt), so dev/typecheck installs get>=1.18.5,<2.5while end-user runtime installs stay unconstrained.setup_slim.pyis untouched — the slim distribution has no numpy dependency and its CI job does not run mypy.Before (unpatched, numpy 2.5.0)
After (patched, numpy 2.4.6)
The cap is enforced by pip's resolver:
pip install -e ".[dev]" "numpy>=2.5"against the patchedsetup.pycorrectly fails withResolutionImpossible.Test plan
ruff format roboflow --checkpasses (69 files)ruff check roboflowpasses (All checks passed!)mypy roboflowpasses (Success: no issues found in 69 source files)python -m unittestpasses (729 tests, OK skipped=1)numpy>=2.5+ patched dev extra -> ResolutionImpossible)requirements.txtunchanged — end-user installs unaffectedFixes #498