mirror of
https://github.com/hwchase17/langchain
synced 2024-11-02 09:40:22 +00:00
edd68e4ad4
## Description This PR introduces the new `langchain-qdrant` partner package, intending to deprecate the community package. ## Changes - Moved the Qdrant vector store implementation `/libs/partners/qdrant` with integration tests. - The conditional imports of the client library are now regular with minor implementation improvements. - Added a deprecation warning to `langchain_community.vectorstores.qdrant.Qdrant`. - Replaced references/imports from `langchain_community` with either `langchain_core` or by moving the definitions to the `langchain_qdrant` package itself. - Updated the Qdrant vector store documentation to reflect the changes. ## Testing - `QDRANT_URL` and [`QDRANT_API_KEY`](583e36bf6b
) env values need to be set to [run integration tests](d608c93d1f
) in the [cloud](https://cloud.qdrant.tech). - If a Qdrant instance is running at `http://localhost:6333`, the integration tests will use it too. - By default, tests use an [`in-memory`](https://github.com/qdrant/qdrant-client?tab=readme-ov-file#local-mode) instance(Not comprehensive). --------- Co-authored-by: Erick Friis <erick@langchain.dev> Co-authored-by: Erick Friis <erickfriis@gmail.com>
61 lines
1.9 KiB
Makefile
61 lines
1.9 KiB
Makefile
.PHONY: all format lint test tests integration_test integration_tests help
|
|
|
|
# Default target executed when no arguments are given to make.
|
|
all: help
|
|
|
|
# Define a variable for the test file path.
|
|
TEST_FILE ?= tests/unit_tests/
|
|
|
|
integration_test integration_tests: TEST_FILE = tests/integration_tests/
|
|
|
|
test tests integration_test integration_tests:
|
|
poetry run pytest $(TEST_FILE)
|
|
|
|
|
|
######################
|
|
# LINTING AND FORMATTING
|
|
######################
|
|
|
|
# Define a variable for Python and notebook files.
|
|
PYTHON_FILES=.
|
|
MYPY_CACHE=.mypy_cache
|
|
lint format: PYTHON_FILES=.
|
|
lint_diff format_diff: PYTHON_FILES=$(shell git diff --relative=libs/partners/qdrant --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$')
|
|
lint_package: PYTHON_FILES=langchain_qdrant
|
|
lint_tests: PYTHON_FILES=tests
|
|
lint_tests: MYPY_CACHE=.mypy_cache_test
|
|
|
|
lint lint_diff lint_package lint_tests:
|
|
poetry run ruff .
|
|
poetry run ruff format $(PYTHON_FILES) --diff
|
|
poetry run ruff --select I $(PYTHON_FILES)
|
|
mkdir $(MYPY_CACHE); poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE)
|
|
|
|
format format_diff:
|
|
poetry run ruff format $(PYTHON_FILES)
|
|
poetry run ruff --select I --fix $(PYTHON_FILES)
|
|
|
|
spell_check:
|
|
poetry run codespell --toml pyproject.toml
|
|
|
|
spell_fix:
|
|
poetry run codespell --toml pyproject.toml -w
|
|
|
|
check_imports: $(shell find langchain_qdrant -name '*.py')
|
|
poetry run python ./scripts/check_imports.py $^
|
|
|
|
######################
|
|
# HELP
|
|
######################
|
|
|
|
help:
|
|
@echo '----'
|
|
@echo 'check_imports - check imports'
|
|
@echo 'format - run code formatters'
|
|
@echo 'lint - run linters'
|
|
@echo 'test - run unit tests'
|
|
@echo 'tests - run unit tests'
|
|
@echo 'test TEST_FILE=<test_file> - run all tests in file'
|
|
@echo 'integration_test - run integration tests'
|
|
@echo 'integration_tests - run integration tests'
|