-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
101 lines (81 loc) · 2.18 KB
/
Copy pathMakefile
File metadata and controls
101 lines (81 loc) · 2.18 KB
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
.PHONY: certs
certs:
mkdir certs
openssl rand -hex 32 > certs/secret.key
openssl genrsa -out certs/jwt-private.pem 2048
openssl rsa -in certs/jwt-private.pem -pubout -out certs/jwt-public.pem
.PHONY: deps
deps:
docker compose -f docker-compose.dev.yml up postgres redis -d --build --remove-orphans --wait
.PHONY: up
up:
docker compose -f docker-compose.dev.yml up --build --remove-orphans --wait
.PHONY: build
build:
docker build -t fastid:latest -f docker/Dockerfile .
.PHONY: up-obs
up-obs:
docker compose -f docker-compose.dev.yml -f docker-compose.observability.yml up --build --remove-orphans --wait
.PHONY: up-prod
up-prod:
docker compose -f docker-compose.dev.yml -f docker-compose.prod.yml up --build --remove-orphans --wait
.PHONY: up-prod-obs
up-prod-obs:
docker compose -f docker-compose.dev.yml -f docker-compose.prod.yml -f docker-compose.observability.yml up --build --remove-orphans --wait
.PHONY: up-example
up-example:
docker compose -f docker-compose.example.yml up --build --remove-orphans --wait
.PHONY: test
test:
pytest . -x -s -v --ff -m 'not slow'
.PHONY: testcov
testcov:
coverage run -m pytest -x --ff -m 'not slow'
coverage combine
coverage report --show-missing --skip-covered --sort=cover --precision=2
coverage html
rm .coverage*
.PHONY: stop
stop:
docker compose -f docker-compose.dev.yml stop
.PHONY: down
down:
docker compose -f docker-compose.dev.yml down
.PHONY: restart
restart:
docker compose -f docker-compose.dev.yml restart
.PHONY: lint
lint:
@echo "Running ruff linter (isort, flake, pyupgrade, etc. replacement)..."
ruff check . --fix
@echo "Running ruff formatter (black replacement)..."
ruff format .
@echo "Running codespell to find typos..."
codespell .
.PHONY: static
static:
@echo "Running mypy..."
mypy .
.PHONY: check
check:
pre-commit run
.PHONY: check-all
check-all:
pre-commit run --all-files
.PHONY: generate
generate: deps
alembic revision -m "$(NAME)" --autogenerate
alembic upgrade head
alembic downgrade -1
alembic upgrade head
alembic downgrade -1
PHONY: upgrade
upgrade: deps
alembic upgrade head
PHONY: downgrade
downgrade: deps
alembic downgrade -1
# Windows only
PHONY: kill
kill:
TASKKILL /F /IM python.exe