-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
49 lines (35 loc) · 1.11 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
.PHONY: ruff black test isort mypy unit check-code build up down test
.DEFAULT_GOAL := help
APP_PATH := service
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
ruff: ## Check formatting with ruff
poetry run ruff ${APP_PATH}
black: ## Format code with black
poetry run black ${APP_PATH}
isort: ## Check sorting with isort
poetry run isort ${APP_PATH}
mypy: ## Check typing with mypy
poetry run mypy ${APP_PATH}
unit: ## Run unit tests
poetry run pytest -m unit
check-code: ruff black isort mypy unit ## Run all code checks
build: ## Build compose
docker-compose build
up: ## Start compose
docker-compose up -d
up-dev: ## Start all services except bertopic
docker-compose up -d --build --scale bertopic=0
down: ## Down compose
docker-compose down
test: ## Run integration tests
docker-compose run --rm --no-deps bertopic bash -c "alembic upgrade head && pytest -m slow"