Skip to content

Remove the numpy<2.4 cap from runtime requirements - #519

Merged
iurisilvio merged 2 commits into
roboflow:mainfrom
cdeil:fix-numpy-runtime-metadata
Oct 7, 2026
Merged

iurisilvio merged 2 commits into
roboflow:mainfrom
cdeil:fix-numpy-runtime-metadata

Conversation

@cdeil

@cdeil cdeil commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • requirements.txt: numpy>=1.18.5,<2.4 → numpy>=1.18.5, and drop the comment that explains the cap

Motivation

setup.py publishes requirements.txt as install_requires, so every release since 1.4.0 carries the cap as a runtime requirement. For users this means:

  • roboflow>=1.4 cannot be installed together with NumPy 2.4 or newer; pip and uv report a conflict.
  • An unpinned roboflow silently resolves to an older release instead, 1.3.13 next to NumPy 2.4 and 1.3.10 next to NumPy 2.5 (checked with uv pip compile), so users lose everything added since 1.4.

The cap exists only for the type check: mypy runs with python_version = "3.10" and could not parse the PEP 695 type statements in NumPy's newer stubs (#498). #499 proposed a cap in the dev extra only, but the cap landed in requirements.txt via #495 and #496. Since then, pyproject.toml has gained a mypy override for numpy (follow_imports = "skip"), which solves the type-check problem on its own, so the cap is not needed anywhere, not even in the dev extra. (An earlier revision of this PR moved the cap to the dev extra; after rebasing onto current main that is no longer necessary.)

Test plan

On current main (7faa0dd) plus this PR, with Python 3.13, NumPy 2.5.3 and mypy 2.4.0:

  • make check_code_quality (ruff format, ruff check, mypy over 78 source files) passes
  • python -m unittest: 1209 tests OK (1 skipped)
  • the built wheel declares Requires-Dist: numpy>=1.18.5, and resolving roboflow[dev] from it picks NumPy 2.5.3

@socket-security

socket-security Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedpypi/​numpy@​2.3.5 ⏵ 2.5.375 +110010010070

View full report

cdeil and others added 2 commits October 7, 2026 11:57
The mypy override for numpy in pyproject.toml and current mypy releases
type-check the package with NumPy 2.5 under python_version 3.10, so the
dev extra no longer needs a NumPy upper bound.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cdeil
cdeil force-pushed the fix-numpy-runtime-metadata branch from d51ad88 to d642b54 Compare October 7, 2026 10:34
@cdeil cdeil changed the title Keep NumPy type-check cap out of runtime metadata Remove the numpy<2.4 cap from runtime requirements Oct 7, 2026
@cdeil

cdeil commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Hi @iurisilvio and @digaobarbosa, a friendly ping on this one. Since 1.4.0, roboflow cannot be installed next to NumPy 2.4 or newer, and an unpinned roboflow silently falls back to 1.3.13 (NumPy 2.4) or 1.3.10 (NumPy 2.5).

I rebased the PR onto current main and simplified it: thanks to the mypy override for numpy in pyproject.toml, the cap is no longer needed for type checking, so the PR now just removes it instead of moving it to the dev extra. I updated the description accordingly. With Python 3.13 and NumPy 2.5.3, make check_code_quality and the full test suite pass locally.

The "Test WorkFlow" run is waiting for maintainer approval (action_required).

If you have a minute, #520 is a similarly small fix: it lets roboflow-slim installs import Version.

Thanks for maintaining the SDK!

@iurisilvio
iurisilvio merged commit af0e172 into roboflow:main Oct 7, 2026
12 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