2023-05-12 18:50:08 +00:00
|
|
|
.PHONY: all clean format lint test tests test_watch integration_tests docker_tests help extended_tests
|
2022-10-24 21:51:15 +00:00
|
|
|
|
2023-02-14 05:08:47 +00:00
|
|
|
all: help
|
2023-04-01 16:00:09 +00:00
|
|
|
|
2022-12-13 13:48:53 +00:00
|
|
|
coverage:
|
|
|
|
poetry run pytest --cov \
|
|
|
|
--cov-config=.coveragerc \
|
|
|
|
--cov-report xml \
|
|
|
|
--cov-report term-missing:skip-covered
|
|
|
|
|
2023-02-14 05:08:47 +00:00
|
|
|
clean: docs_clean
|
|
|
|
|
2023-01-05 05:39:50 +00:00
|
|
|
docs_build:
|
|
|
|
cd docs && poetry run make html
|
|
|
|
|
|
|
|
docs_clean:
|
|
|
|
cd docs && poetry run make clean
|
|
|
|
|
|
|
|
docs_linkcheck:
|
|
|
|
poetry run linkchecker docs/_build/html/index.html
|
|
|
|
|
2022-10-24 21:51:15 +00:00
|
|
|
format:
|
2022-12-04 00:42:59 +00:00
|
|
|
poetry run black .
|
2023-02-25 16:59:52 +00:00
|
|
|
poetry run ruff --select I --fix .
|
2022-10-24 21:51:15 +00:00
|
|
|
|
2023-04-05 16:34:24 +00:00
|
|
|
PYTHON_FILES=.
|
|
|
|
lint: PYTHON_FILES=.
|
|
|
|
lint_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d master | grep -E '\.py$$')
|
|
|
|
|
|
|
|
lint lint_diff:
|
|
|
|
poetry run mypy $(PYTHON_FILES)
|
|
|
|
poetry run black $(PYTHON_FILES) --check
|
2023-02-25 16:59:52 +00:00
|
|
|
poetry run ruff .
|
2022-10-24 21:51:15 +00:00
|
|
|
|
2023-05-10 13:39:22 +00:00
|
|
|
TEST_FILE ?= tests/unit_tests/
|
|
|
|
|
2023-02-14 05:08:47 +00:00
|
|
|
test:
|
2023-05-16 18:41:24 +00:00
|
|
|
poetry run pytest --disable-socket --allow-unix-socket $(TEST_FILE)
|
2023-02-14 05:08:47 +00:00
|
|
|
|
2023-05-16 18:41:24 +00:00
|
|
|
tests:
|
|
|
|
poetry run pytest --disable-socket --allow-unix-socket $(TEST_FILE)
|
2022-10-24 21:51:15 +00:00
|
|
|
|
2023-05-12 18:50:08 +00:00
|
|
|
extended_tests:
|
2023-05-16 18:41:24 +00:00
|
|
|
poetry run pytest --disable-socket --allow-unix-socket --only-extended tests/unit_tests
|
2023-05-12 18:50:08 +00:00
|
|
|
|
2023-02-14 05:08:47 +00:00
|
|
|
test_watch:
|
2022-12-28 22:13:08 +00:00
|
|
|
poetry run ptw --now . -- tests/unit_tests
|
|
|
|
|
2022-10-24 21:51:15 +00:00
|
|
|
integration_tests:
|
2022-12-04 00:42:59 +00:00
|
|
|
poetry run pytest tests/integration_tests
|
2023-02-14 05:08:47 +00:00
|
|
|
|
2023-04-01 16:00:09 +00:00
|
|
|
docker_tests:
|
|
|
|
docker build -t my-langchain-image:test .
|
|
|
|
docker run --rm my-langchain-image:test
|
|
|
|
|
2023-02-14 05:08:47 +00:00
|
|
|
help:
|
|
|
|
@echo '----'
|
2023-05-10 13:39:22 +00:00
|
|
|
@echo 'coverage - run unit tests and generate coverage report'
|
|
|
|
@echo 'docs_build - build the documentation'
|
|
|
|
@echo 'docs_clean - clean the documentation build artifacts'
|
|
|
|
@echo 'docs_linkcheck - run linkchecker on the documentation'
|
|
|
|
@echo 'format - run code formatters'
|
|
|
|
@echo 'lint - run linters'
|
|
|
|
@echo 'test - run unit tests'
|
2023-05-15 14:34:44 +00:00
|
|
|
@echo 'tests - run unit tests'
|
2023-05-10 13:39:22 +00:00
|
|
|
@echo 'test TEST_FILE=<test_file> - run all tests in file'
|
2023-05-12 18:50:08 +00:00
|
|
|
@echo 'extended_tests - run only extended unit tests'
|
2023-05-10 13:39:22 +00:00
|
|
|
@echo 'test_watch - run unit tests in watch mode'
|
|
|
|
@echo 'integration_tests - run integration tests'
|
|
|
|
@echo 'docker_tests - run unit tests in docker'
|