Skip to content

fix: allow numpy 2.x on Python 3.13 (fix broken install) - #270

Merged
cat101 merged 2 commits into
mainfrom
fix/numpy2-py313
Aug 12, 2026
Merged

fix: allow numpy 2.x on Python 3.13 (fix broken install)#270
cat101 merged 2 commits into
mainfrom
fix/numpy2-py313

Conversation

@cat101

@cat101 cat101 commented Aug 12, 2026

Copy link
Copy Markdown
Member

Problem

pip install "landingai~=0.3.0" on Python 3.13 fails at import (QA release_2026_cw_33 — Asana):

File ".../numpy/core/getlimits.py", line 52, in __init__
    self.precision = int(-log10(self.eps))
OverflowError: cannot convert longdouble infinity to integer

Root cause: numpy = ">=1.21.0,<2.0.0". numpy 1.x publishes no cp313 wheels, so pip builds numpy 1.26.4 from sdist, and that build is broken on Windows under Python 3.13. It fails during numpy init, before any SDK code runs.

Fix

Make the numpy floor Python-version-conditional — keep 1.x below 3.13, require 2.1+ (first cp313 wheels) at 3.13+:

numpy = [
    { version = ">=1.21.0,<2.0.0", python = "<3.13" },
    { version = ">=2.1.0,<3.0.0", python = ">=3.13" },
]

Existing Python 3.9–3.12 users keep numpy 1.x, so their resolution is unchanged.

numpy 2.x is safe for this SDK. The only numpy APIs used are ndarray, array, asarray, uint8, bool_, float32/int32, float16, stack, expand_dims, count_nonzero, unique, save/load — none removed in the 2.0 migration. Grepped the tree for every 2.0-removed alias (np.float_, np.int0, bare np.bool, np.NaN, np.in1d, …): zero hits.

Verification (Python 3.13.14)

  • Deps resolve to wheels only, no source build: numpy 2.5.2, pillow 10.4.0, opencv-python 4.14, pandas 2.3.3, aiohttp 3.14, pydantic 2.13.
  • from landingai.predict import Predictor imports cleanly — the QA OverflowError is gone.
  • poetry lock --no-update regenerated; diff is numpy-only (adds the 2.5.2 stanza + content hash), no other package moved.

Notes for the maintainer

  • Not merging this myself — merge to main auto-runs the Release job (poetry publish --build), a PyPI release that should be your call.
  • Consider adding "3.13" to the CI python-version matrix so this path is covered going forward. I left the matrix alone to avoid entangling with the retired macos-12 runner already in it.
  • pillow<11.0 and opencv-python<5.0 already resolve to cp313 wheels within their current ranges (10.4.0 / 4.14), so no change needed there.

🤖 Generated with Claude Code

cat101 and others added 2 commits August 11, 2026 22:57
`numpy = ">=1.21.0,<2.0.0"` has no cp313 wheels, so `pip install
landingai` on Python 3.13 builds numpy 1.26.4 from sdist, which fails on
Windows with `OverflowError: cannot convert longdouble infinity to
integer` during numpy init — before any SDK code runs
(QA release_2026_cw_33, Asana 1217364662313623).

Make the numpy floor Python-version-conditional: keep 1.x for <3.13,
require 2.1+ (first cp313 wheels) for >=3.13. The SDK only uses numpy
APIs that survive the 2.0 migration (ndarray, array, asarray, uint8,
bool_, float32/int32, stack, expand_dims, count_nonzero — no removed
aliases), so 2.x is safe.

Verified on Python 3.13.14: deps resolve to wheels with no source build
(numpy 2.5.2, pillow 10.4.0, opencv 4.14, pandas 2.3.3), and
`from landingai.predict import Predictor` imports cleanly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cat101
cat101 merged commit e6c9adf into main Aug 12, 2026
1 of 13 checks passed
@cat101
cat101 deleted the fix/numpy2-py313 branch August 12, 2026 02:47
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.

1 participant