forked from cohere-ai/cohere-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
109 lines (85 loc) · 2.27 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
.PHONY: dev
dev:
make -j 2 watch up
.PHONY: watch
watch:
@docker compose watch --no-up
.PHONY: up
up:
@docker compose up --build
.PHONY: down
down:
@docker compose down
.PHONY: run-unit-tests
run-unit-tests:
docker compose run --build backend poetry run pytest src/backend/tests/unit/$(file)
.PHONY: run-community-tests
run-community-tests:
docker compose run --build backend poetry run pytest src/community/tests/$(file)
.PHONY: run-integration-tests
run-integration-tests:
docker compose run --build backend poetry run pytest src/backend/tests/integration/$(file)
run-tests: run-unit-tests
.PHONY: attach
attach:
@docker attach cohere-toolkit-backend-1
logs:
@docker compose logs -f backend
.PHONY: exec-backend
exec-backend:
docker exec -ti cohere-toolkit-backend-1 bash
.PHONY: exec-db
exec-db:
docker exec -ti cohere-toolkit-db-1 bash
.PHONY: migration
migration:
docker compose run --build backend alembic -c src/backend/alembic.ini revision --autogenerate
.PHONY: migrate
migrate:
docker compose run --build backend alembic -c src/backend/alembic.ini upgrade head
.PHONY: downgrade
downgrade:
docker compose run --build backend alembic -c src/backend/alembic.ini downgrade -1
.PHONY: reset-db
reset-db:
docker compose down
docker volume rm cohere_toolkit_db
.PHONY: setup
setup:
poetry install --with setup --verbose
poetry run python3 src/backend/cli/main.py
.PHONY: setup-use-community
setup-use-community:
poetry install --with setup,community --verbose
poetry run python3 src/backend/cli/main.py --use-community
.PHONY: win-setup
win-setup:
poetry install --with setup --verbose
poetry run python src/backend/cli/main.py
.PHONY: lint
lint:
poetry run autoflake --in-place --recursive --ignore-init-module-imports .
poetry run black .
poetry run isort .
.PHONY: first-run
first-run:
make setup
make migrate
make dev
.PHONY: win-first-run
win-first-run:
make win-setup
make migrate
make dev
.PHONY: format-web
format-web:
cd src/interfaces/coral_web && npm run format:write
.PHONY: generate-client-web
generate-client-web:
cd src/interfaces/coral_web && npm run generate:client && npm run format:write
.PHONY: install-web
install-web:
cd src/interfaces/coral_web && npm install
.PHONY: build-web
build-web:
cd src/interfaces/coral_web && npm run build