-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
66 lines (50 loc) · 1.83 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.PHONY: all bump_version clean format lint test tests test_watch integration_tests docker_tests help
all: help
bump_version:
poetry version patch
coverage:
poetry run pytest --cov \
--cov-config=.coveragerc \
--cov-report xml \
--cov-report term-missing:skip-covered
clean: docs_clean
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
format:
poetry run black .
poetry run ruff --select I --fix .
PYTHON_FILES=$(shell find . -type f -name '*.py' -not -path "./ipython_logs/*")
lint: PYTHON_FILES=$(shell find . -type f -name '*.py' -not -path "./ipython_logs/*")
lint_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d master | grep -v 'ipython_logs/' | grep -E '\.py$$')
lint lint_diff:
poetry run mypy $(PYTHON_FILES)
poetry run black $(PYTHON_FILES) --check
poetry run ruff .
test:
poetry run pytest tests/unit_tests
tests:
poetry run pytest tests/unit_tests
test_watch:
poetry run ptw --now . -- tests/unit_tests
integration_tests:
poetry run pytest tests/integration_tests
docker_tests:
docker build -t llm4data-image:test .
docker run --rm llm4data-image:test
help:
@echo '----'
@echo 'bump_version - run version update'
@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'
@echo 'test_watch - run unit tests in watch mode'
@echo 'integration_tests - run integration tests'
@echo 'docker_tests - run unit tests in docker'