chore(community): unpin numpy version#523
Open
Mark Molinaro (markjm) wants to merge 1 commit intolangchain-ai:mainfrom
Open
chore(community): unpin numpy version#523Mark Molinaro (markjm) wants to merge 1 commit intolangchain-ai:mainfrom
Mark Molinaro (markjm) wants to merge 1 commit intolangchain-ai:mainfrom
Conversation
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!
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.
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.
so we use v2 unless specifically requested
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.