This repository has been archived by the owner on Aug 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (43 loc) · 1.4 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
.PHONY: psql up down venv check-deps update-deps install-deps isort black mypy flake8 bandit lint test migrate serve
ifneq (,$(wildcard ./.env))
include .env
export
endif
VENV=.venv
PYTHON=$(VENV)/bin/python3
cmd-exists-%:
@hash $(*) > /dev/null 2>&1 || \
(echo "ERROR: '$(*)' must be installed and available on your PATH."; exit 1)
psql: cmd-exists-psql
psql "${DATABASE_URL}"
up: ## Run Docker Compose services
docker-compose -f docker-compose.local.yml up -d
down: ## Shutdown Docker Compose services
docker-compose -f docker-compose.local.yml down
venv: requirements-dev.txt Makefile
python3 -m venv $(VENV)
$(PYTHON) -m pip install --upgrade pip setuptools wheel
$(PYTHON) -m pip install -r requirements-dev.txt
check-deps: ## Check new versions and update deps
$(PYTHON) -m pur -r requirements-dev.txt -d
update-deps: ## Check new versions and update deps
$(PYTHON) -m pur -r requirements-dev.txt
install-deps: ## Install dependencies
$(PYTHON) -m pip install -r requirements-dev.txt
isort:
$(PYTHON) -m isort --check-only .
black:
$(PYTHON) -m black --check .
mypy:
$(PYTHON) -m mypy .
flake8:
$(PYTHON) -m flake8 .
bandit:
$(PYTHON) -m bandit -r app
lint: isort black mypy flake8 bandit
test: ## Run tests
$(PYTHON) -m pytest
migrate: ## Apply latest alembic migrations
$(PYTHON) -m alembic upgrade head
serve: ## Run application server in development
$(PYTHON) main.py