Skip to content

chore(community): unpin numpy version#523

Open
Mark Molinaro (markjm) wants to merge 1 commit intolangchain-ai:mainfrom
markjm:markjm/numpy
Open

chore(community): unpin numpy version#523
Mark Molinaro (markjm) wants to merge 1 commit intolangchain-ai:mainfrom
markjm:markjm/numpy

Conversation

@markjm
Copy link

@markjm Mark Molinaro (markjm) commented Feb 4, 2026

Description

as evidenced by allowing numpy@v1 for many python versions, this package does not depend on numpy v2.

I made this same change in langchain-ai/langchain-aws#859 so I am copy-pasting the reasoning below:


The package works fine in any version of numpy (>1,<3). Restricting to >2.2 for py3.12 and above means folks still using numpy v1 will face conflict with this package for no technical reason ( :( still using numpy v1, but i suspect I am not alone)

Note that without this specifier, package resolution is still bounded by numpy supported versions as declared in numpy's requires_python tags. As such, this change should:

not change any dependency resolution for projects which already (or can use) numpy v2 not unduly pull in numpy v2 in python versions which cant support it enable folks to use this package when using py3.12/numpy@v1 Should this package actually come to use or rely on numpy@v2 functionality, then makes sense to bump this. But for now seems this may as well loosen, if possible to be more permissive.

$ uv venv --python 3.13 --clear && uv pip install . && (uv pip freeze | grep numpy) Using CPython 3.13.8
numpy==2.4.2
$ uv venv --python 3.12 --clear && uv pip install . && (uv pip freeze | grep numpy) Using CPython 3.12.10
numpy==2.4.2
$ uv venv --python 3.11 --clear && uv pip install . && (uv pip freeze | grep numpy) Using CPython 3.11.14
numpy==2.4.2
$ uv venv --python 3.10 --clear && uv pip install . && (uv pip freeze | grep numpy) Using CPython 3.10.18
numpy==2.2.6

so we use v2 unless specifically requested

uv venv --python 3.12 --clear && uv pip install . numpy==1.26.4
numpy==1.26.4

Issue

None, but I can create one if you'd like!

Dependencies

I presume this part is asking about dependencies on other code/systems being present, so none.

as evidenced by allowing numpy@v1 for many python versions, this package does not depend on numpy v2.

I made this same change in langchain-ai/langchain-aws#859 so I am copy-pasting the reasoning below:

--

The package works fine in any version of numpy (>1,<3). Restricting to >2.2 for py3.12 and above means folks still using numpy v1 will face conflict with this package for no technical reason ( :( still using numpy v1, but i suspect I am not alone)

Note that without this specifier, package resolution is still bounded by numpy supported versions as declared in numpy's requires_python tags. As such, this change should:

not change any dependency resolution for projects which already (or can use) numpy v2
not unduly pull in numpy v2 in python versions which cant support it
enable folks to use this package when using py3.12/numpy@v1
Should this package actually come to use or rely on numpy@v2 functionality, then makes sense to bump this. But for now seems this may as well loosen, if possible to be more permissive.

$ uv venv --python 3.13 --clear && uv pip install . && (uv pip freeze | grep numpy)
Using CPython 3.13.8
numpy==2.4.2
$ uv venv --python 3.12 --clear && uv pip install . && (uv pip freeze | grep numpy)
Using CPython 3.12.10
numpy==2.4.2
$ uv venv --python 3.11 --clear && uv pip install . && (uv pip freeze | grep numpy)
Using CPython 3.11.14 interpreter at: /usr/bin/python3.11
numpy==2.4.2
$ uv venv --python 3.10 --clear && uv pip install . && (uv pip freeze | grep numpy)
Using CPython 3.10.18
numpy==2.2.6
so we use v2 unless specifically requestes

uv venv --python 3.12 --clear && uv pip install . numpy==1.26.4
numpy==1.26.4
Followed https://docs.langchain.com/oss/python/contributing/code#submitting-your-pr, but don't have a related issue. I can open one if there is interest in this change. Thanks so much for the project!
@github-actions github-actions bot added infra and removed infra labels Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant