-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile
71 lines (56 loc) · 1.65 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
# Makefile
# ------------------------ #
# Serve #
# ------------------------ #
start:
@if [ -f env.sh ]; then source env.sh; fi; fastapi dev 'www/app/main.py' --port 8080
.PHONY: start
update-api:
@cd frontend && rm -rf src/gen/api.ts && openapi-typescript http://localhost:8080/openapi.json --output src/gen/api.ts
.PHONY: update-api
start-docker-dynamodb:
@docker kill www-db || true
@docker rm www-db || true
@docker run --name www-db -d -p 8000:8000 amazon/dynamodb-local
.PHONY: start-docker-dynamodb
start-docker-backend:
@docker kill www-backend || true
@docker rm www-backend || true
@docker build -t www-backend .
@docker run --name www-backend -d -p 8080:8080 www-backend
.PHONY: start-docker-backend
start-docker-localstack:
@docker kill www-localstack || true
@docker rm www-localstack || true
@docker run -d --name www-localstack -p 4566:4566 -p 4571:4571 localstack/localstack
.PHONY: start-docker-localstack
# ------------------------ #
# Install #
# ------------------------ #
install:
@pip install -e '[.dev]'
.PHONY: install
# ------------------------ #
# Code Formatting #
# ------------------------ #
format:
@black www tests
@ruff check --fix www tests
.PHONY: format
# ------------------------ #
# Static Checks #
# ------------------------ #
lint:
@black --diff --check www tests
@ruff check www tests
@mypy --install-types --non-interactive www tests
.PHONY: lint
# ------------------------ #
# Unit tests #
# ------------------------ #
test-backend:
@python -m pytest
.PHONY: test-backend
# test: test-backend test-frontend
test: test-backend
.PHONY: test