Skip to content

chore(deps): allow numpy 2 on Python 3.12+ and disable numpy updates for older Pythons - #816

Merged
twishabansal merged 3 commits into
mainfrom
chore/numpy2-py312
Oct 26, 2026
Merged

twishabansal merged 3 commits into
mainfrom
chore/numpy2-py312

Conversation

@twishabansal

@twishabansal twishabansal commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #813 and #815. Same approach as googleapis/llama-index-cloud-sql-pg-python#227.

numpy 2.x stubs use the Python 3.12 type statement. With [tool.mypy] python_version = "3.10", mypy fails on numpy/__init__.pyi: Type statement is only supported in Python 3.12 and greater.

  • Test extras: numpy<2 on Python < 3.12, numpy<3 on Python >= 3.12.
  • mypy keeps python_version = "3.10" (still catches 3.11+-only code). A numpy.* override sets follow_imports = "skip" and follow_imports_for_stubs = true, so mypy does not parse numpy's stubs. The second flag is required because numpy ships .pyi stubs.
  • Renovate: disable updates for the <2 constraint.

Verified locally with numpy 2.5.4 and MYPYPATH=./src (as CI does): mypy -p toolbox_adk passes; without the override it reproduces the CI error.

@twishabansal
twishabansal requested a review from a team as a code owner October 22, 2026 14:46
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.

3 participants