-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (54 loc) · 1.23 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
# Makefile for Django project
# Variables
POETRY = poetry
MANAGE = $(POETRY) run python homedb/manage.py
DJANGO_SETTINGS_MODULE ?= homedb.settings
export DJANGO_SETTINGS_MODULE
# Targets
.PHONY: help
help:
@echo "Available targets:"
@echo " help - Display this help message"
@echo " install - Install project requirements"
@echo " migrate - Run database migrations"
@echo " makemigrations - Create new migrations"
@echo " runserver - Run the development server"
@echo " test - Run the test suite"
@echo " lint - Run linters"
@echo " superuser - Create a Django superuser"
@echo " format - Run Black and isort"
.PHONY: install
install:
$(POETRY) install
.PHONY: migrate
migrate:
$(MANAGE) migrate
.PHONY: makemigrations
makemigrations:
$(MANAGE) makemigrations
.PHONY: runserver
runserver:
$(MANAGE) runserver
.PHONY: test
test:
$(MANAGE) test homedb/
.PHONY: lint
lint:
$(POETRY) run ruff .
.PHONY: superuser
superuser:
$(MANAGE) createsuperuser
.PHONY: format
format:
$(POETRY) run isort .
$(POETRY) run black .
.PHONY: clean
clean:
rm -rf .venv
rm -rf .pytest_cache
rm -rf .coverage
rm -rf .mypy_cache
rm -rf .cache
rm -rf .eggs
rm -rf .tox
rm -rf .ruff_cache