-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (36 loc) · 898 Bytes
/
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
VIRTUAL_ENV ?= .venv
PACKAGE = summary
# Setup Dev Env
# -------------
poetry.lock: pyproject.toml
@poetry lock
$(VIRTUAL_ENV): poetry.lock
@poetry install --with dev
@poetry self add poetry-bumpversion
@poetry run pre-commit install
@poetry export --without-hashes --output assets/requirements.txt
@touch $(VIRTUAL_ENV)
.PHONY: setup
setup: $(VIRTUAL_ENV)
.PHONY: t test
t test: setup
@poetry run pytest $(PACKAGE)
.PHONY: lint
lint: setup
@poetry run mypy
@poetry run ruff api
# Database
# --------
migrate: setup
@poetry run muffin $(PACKAGE) peewee-migrate
rollback: setup
@poetry run muffin $(PACKAGE) peewee-rollback
# Run
# ---
MUFFIN_PORT ?= 5555
.PHONY: run dev
run dev: setup migrate
@poetry run uvicorn --loop asyncio --reload --reload-dir $(PACKAGE) --port $(MUFFIN_PORT) $(PACKAGE):app
.PHONY: shell
shell: setup
@poetry run muffin $(PACKAGE) shell --ipython