forked from i-dot-ai/redbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
86 lines (64 loc) · 2.48 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.PHONY: app reqs
-include .env
export
reqs:
poetry install
run:
docker compose up -d elasticsearch kibana embedder ingester minio redis core-api db django-app
stop:
docker compose down
clean:
docker compose down -v --rmi all --remove-orphans
build:
docker compose build
rebuild:
docker compose build --no-cache
test-core-api:
poetry install --no-root --no-ansi --with worker,api,dev --without ai,ingester
poetry run pytest core_api/tests --cov=core_api/src -v --cov-report=term-missing --cov-fail-under=45
test-embedder:
poetry install --no-root --no-ansi --with worker,api,dev --without ai,ingester
poetry run pytest embedder/tests --cov=embedder/src -v --cov-report=term-missing --cov-fail-under=50
test-redbox:
poetry install --no-root --no-ansi --with worker,api,dev --without ai,streamlit-app,ingester
poetry run pytest redbox/tests --cov=redbox -v --cov-report=term-missing --cov-fail-under=45
test-ingester:
poetry install --no-root --no-ansi --with worker,ingester,dev --without ai,streamlit-app,api
poetry run pytest ingester/tests --cov=ingester -v --cov-report=term-missing --cov-fail-under=40
test-django:
docker compose up -d --wait db minio
docker compose run django-app poetry run pytest django_app/tests/ --ds redbox_app.settings -v --cov=redbox_app.redbox_core --cov-fail-under 10
test-integration:
docker compose down
cp .env.integration .env
docker compose build core-api embedder ingester minio
docker compose up -d core-api embedder ingester minio
poetry install --no-root --no-ansi --with dev --without ai,streamlit-app,api,worker,ingester
sleep 10
poetry run pytest tests
lint:
poetry run ruff check .
format:
poetry run ruff format .
# additionally we format, but not lint, the notebooks
# poetry run ruff format **/*.ipynb
safe:
poetry run bandit -ll -r ./redbox
poetry run bandit -ll -r ./django_app
poetry run mypy ./redbox --ignore-missing-imports
poetry run mypy ./django_app --ignore-missing-imports
checktypes:
poetry run mypy redbox embedder ingester --ignore-missing-imports
# poetry run mypy legacy_app --follow-imports skip --ignore-missing-imports
check-migrations:
docker compose build django-app
docker compose up -d --wait db minio
docker compose run django-app poetry run python django_app/manage.py migrate
docker compose run django-app poetry run python django_app/manage.py makemigrations --check
reset-db:
docker compose down db --volumes
docker compose up -d db
docs-serve:
poetry run mkdocs serve
docs-build:
poetry run mkdocs build