Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws[patch]: Remove numpy dependency (previously patch to support numpy2) #282

Merged
merged 6 commits into from
Nov 22, 2024

Conversation

ghinch
Copy link
Contributor

@ghinch ghinch commented Nov 19, 2024

Increasing version of numpy to include 2.x.x for the langchain-aws package. Fixes #147

@3coins
Copy link
Collaborator

3coins commented Nov 20, 2024

@ghinch
Thanks for submitting this change. langchain-community and langchain are both still using < 2 for numpy. https://github.com/langchain-ai/langchain/blob/master/libs/community/pyproject.toml#L51
https://github.com/langchain-ai/langchain/blob/master/libs/langchain/pyproject.toml#L49

Are there any implications of allowing v2? What would be the default numpy version installed with this change?

@ghinch
Copy link
Contributor Author

ghinch commented Nov 21, 2024

Thanks for following up @3coins

This PR follows on from the update to langchain-corewhich was released as part of 0.3.19 . I've followed the pattern there which was to simply set the version of numpy to "less than 3". So the support would be there for any 2.x.x version. I believe the default behavior in langchain-core is for it to install the lowest supported version (1.26.2 for core).

I have also opened similar PRs for langchain langchain-ai/langchain#28183 and langchain-community langchain-ai/langchain#28184.

I am not aware of any changes in the 2.x.x versions of numpy which are breaking for any of the Langchain modules (and the CI seems to be passing for all PRs I opened), but I'm happy if you would like to wait for the above PRs to be merged first.

@3coins
Copy link
Collaborator

3coins commented Nov 22, 2024

@ghinch
Since, numpy is already present as dependency in langchain packages, we can remove it as a direct dependency in langchain-aws; I don't think it is directly used anywhere within this package. Run poetry lock to update the poetry lock file, after you remove it in pyproject.toml. I have tested this change, and I don't see any failures. Thanks again for raising this PR.

@ghinch
Copy link
Contributor Author

ghinch commented Nov 22, 2024

Thanks @3coins, makes sense.
I've run poetry remove numpy and committed this change

@ghinch ghinch changed the title aws[patch]: numpy2 aws[patch]: Remove numpy dependency (previously patch to support numpy2) Nov 22, 2024
Copy link
Collaborator

@3coins 3coins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@3coins 3coins merged commit 1bf6ba5 into langchain-ai:main Nov 22, 2024
12 checks passed
3coins added a commit that referenced this pull request Dec 4, 2024
Adds back numpy as dependency which was removed in #282. This is causing
release errors, due to dependency of numpy in the Bedrock embeddings.
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.

Support numpy v2
2 participants