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

fix: revert docarray explicit transitive dependencies and use extras instead #5015

Merged
merged 4 commits into from May 22, 2023
Merged

fix: revert docarray explicit transitive dependencies and use extras instead #5015

merged 4 commits into from May 22, 2023

Conversation

malandis
Copy link
Contributor

@malandis malandis commented May 20, 2023

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

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.
pyproject.toml Outdated Show resolved Hide resolved
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.
@malandis malandis requested a review from hwchase17 May 20, 2023 15:04
Copy link
Contributor

@hwchase17 hwchase17 left a comment

Choose a reason for hiding this comment

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

lgtm!

@hwchase17 hwchase17 added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label May 21, 2023
@eyurtsev eyurtsev merged commit 6eacd88 into langchain-ai:master May 22, 2023
12 checks passed
@eyurtsev
Copy link
Collaborator

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>
@danielchalef danielchalef mentioned this pull request Jun 5, 2023
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>
This was referenced Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm PR looks good. Use to confirm that a PR is ready for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants