-
Notifications
You must be signed in to change notification settings - Fork 15.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: standard tests in cli, test that they run, skip vectorstore tests (
- Loading branch information
Showing
36 changed files
with
1,578 additions
and
636 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,47 @@ | ||
lint lint_diff: | ||
poetry run poe lint | ||
|
||
test: | ||
poetry run poe test | ||
###################### | ||
# LINTING AND FORMATTING | ||
###################### | ||
|
||
format: | ||
poetry run poe format | ||
# 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/cli --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$') | ||
lint_package: PYTHON_FILES=langchain_cli | ||
lint_tests: PYTHON_FILES=tests | ||
lint_tests: MYPY_CACHE=.mypy_cache_test | ||
|
||
lint lint_diff lint_package lint_tests: | ||
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff check $(PYTHON_FILES) | ||
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) --diff | ||
[ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE) && poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE) | ||
|
||
format format_diff: | ||
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) | ||
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff check --select I --fix $(PYTHON_FILES) | ||
|
||
test tests: _test _e2e_test | ||
|
||
PYTHON = .venv/bin/python | ||
|
||
_test: | ||
poetry run pytest tests | ||
|
||
# custom integration testing for cli integration flow | ||
# currently ignores vectorstores test because lacks implementation | ||
_e2e_test: | ||
rm -rf .integration_test | ||
mkdir .integration_test | ||
cd .integration_test && \ | ||
python3 -m venv .venv && \ | ||
$(PYTHON) -m pip install --upgrade poetry && \ | ||
$(PYTHON) -m pip install -e .. && \ | ||
$(PYTHON) -m langchain_cli.cli integration new --name parrot-link --name-class ParrotLink && \ | ||
cd langchain-parrot-link && \ | ||
poetry install --with lint,typing,test && \ | ||
poetry run pip install -e ../../../standard-tests && \ | ||
make format lint tests && \ | ||
poetry install --with test_integration && \ | ||
rm tests/integration_tests/test_vectorstores.py && \ | ||
make integration_test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# type: ignore | ||
""" | ||
Development Scripts for template packages | ||
""" | ||
|
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
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
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
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
Oops, something went wrong.