-
Notifications
You must be signed in to change notification settings - Fork 15k
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
fix: revert docarray explicit transitive dependencies and use extras instead #5015
Merged
eyurtsev
merged 4 commits into
langchain-ai:master
from
malandis:fix/remove-protobuf-dependency
May 22, 2023
Merged
fix: revert docarray explicit transitive dependencies and use extras instead #5015
eyurtsev
merged 4 commits into
langchain-ai:master
from
malandis:fix/remove-protobuf-dependency
May 22, 2023
+15
−20
Conversation
This file contains 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
The docarray [integration PR](#4483) introduced a pinned dependency to protobuf. As library developers, we should avoid pinned dependencies as this quickly leads to incompatibilities with application code. Much less with a heavily used library like protobuf. As we see in the [docarray integration](https://github.com/hwchase17/langchain/pull/4483/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R81-R83), the transitive dependencies of docarray were also listed as langchain dependencies. This is unnecessary as the docarray project has an [extras install](https://github.com/docarray/docarray/blob/a01a05542d17264b8a164bec783633658deeedb8/pyproject.toml#L70) that lists these. This PR reverts the explicit hnswlib and protobuf dependencies and adds the hnswlib extras install for docarray (which installs hnswlib and protobuf). Because version 0.32.0 of the docarray hnswlib extras added protobuf, we bump the docarray dependency from `^0.31.0` to `^0.32.0`.
Also fix merge conflicts in pyproject.toml and poetry.lock.
hwchase17
reviewed
May 20, 2023
An extra was previously introduced for "hnswlib" which only installed "docarray". While "hnswlib" is a dependency of docarray, docarray is a separate integration, so this is misleading to users. There was also a separate extras for "in_memory_store". This is again misleading since there are various in memory stores in the system that are very specific.
hwchase17
approved these changes
May 21, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
hwchase17
added
the
lgtm
PR looks good. Use to confirm that a PR is ready for merging.
label
May 21, 2023
This sounds good. I was trying to provide a minimum protobuf constraint before, but poetry locking was failing. If removing it entirely is working then great! |
dev2049
pushed a commit
that referenced
this pull request
May 24, 2023
Follow up of #5015 Thanks for catching this! Just a small PR to adjust couple of strings to these changes Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Merged
Undertone0809
pushed a commit
to Undertone0809/langchain
that referenced
this pull request
Jun 19, 2023
Follow up of langchain-ai#5015 Thanks for catching this! Just a small PR to adjust couple of strings to these changes Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
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.
tldr: The docarray integration
PR introduced a pinned dependency to protobuf. This is a docarray dependency, not a langchain dependency. Since this is handled by the docarray dependencies, it is unnecessary here.
Further, as a pinned dependency, this quickly leads to incompatibilities with application code that consumes the library. Much less with a heavily used library like protobuf.
Detail: as we see in the docarray
integration, the transitive dependencies of docarray were also listed as langchain dependencies. This is unnecessary as the docarray project has an appropriate extras. The docarray project also does not require this pinned version of protobuf, rather a minimum version. So this pinned version was likely in error.
To fix this, this PR reverts the explicit hnswlib and protobuf dependencies and adds the hnswlib extras install for docarray (which installs hnswlib and protobuf, as originally intended). Because version
0.32.0
of the docarray hnswlib extras added protobuf, we bump the docarray dependency from
^0.31.0
to^0.32.0
.revert docarray explicit transitive dependencies and use extras instead
Who can review?
@dev2049 -- reviewed the original PR
@eyurtsev -- bumped the pinned protobuf dependency a few days ago