fix: allow numpy 2.x on Python 3.13 (fix broken install) - #270
Merged
Conversation
`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>
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.
Problem
pip install "landingai~=0.3.0"on Python 3.13 fails at import (QA release_2026_cw_33 — Asana):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+:
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, barenp.bool,np.NaN,np.in1d, …): zero hits.Verification (Python 3.13.14)
from landingai.predict import Predictorimports cleanly — the QAOverflowErroris gone.poetry lock --no-updateregenerated; diff is numpy-only (adds the 2.5.2 stanza + content hash), no other package moved.Notes for the maintainer
mainauto-runs theReleasejob (poetry publish --build), a PyPI release that should be your call."3.13"to the CIpython-versionmatrix so this path is covered going forward. I left the matrix alone to avoid entangling with the retiredmacos-12runner already in it.pillow<11.0andopencv-python<5.0already resolve to cp313 wheels within their current ranges (10.4.0 / 4.14), so no change needed there.🤖 Generated with Claude Code