-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (38 loc) · 1.2 KB
/
Makefile
File metadata and controls
52 lines (38 loc) · 1.2 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
ENV_RUN := poetry run
DJANGO_MANAGE := $(ENV_RUN) python manage.py
PYTHON := $(ENV_RUN) python
.PHONY: help runserver migrate makemigrations test pytest-coverage lint format collectstatic shell
help:
@echo "Common Django project commands:"
@echo " make runserver # Start Django development server"
@echo " make migrate # Apply database migrations"
@echo " make makemigrations # Create new migrations"
@echo " make test # Run all tests"
@echo " make pytest-coverage # Run tests with coverage (HTML report)"
@echo " make lint # Run ruff linting"
@echo " make format # Auto-format code with ruff"
@echo " make collectstatic # Collect static files"
@echo " make shell # Open Django shell"
runserver:
$(DJANGO_MANAGE) runserver
migrate:
$(DJANGO_MANAGE) migrate
makemigrations:
$(DJANGO_MANAGE) makemigrations
test:
$(ENV_RUN) pytest
coverage:
$(ENV_RUN) coverage run -m pytest
$(ENV_RUN) coverage html
lint:
$(ENV_RUN) ruff check .
format:
$(ENV_RUN) ruff format .
collectstatic:
$(DJANGO_MANAGE) collectstatic --noinput
shell:
$(DJANGO_MANAGE) shell
precommit:
$(ENV_RUN) pre-commit run
deptrycheck:
$(ENV_RUN) deptry .