-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (34 loc) · 957 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
48
49
50
51
52
53
54
55
56
57
58
59
VENV_NAME = contact-app-django
PYTHON_VERSION = python3.10
UV_TOOL := $(shell command -v uv)
ifeq ($(UV_TOOL),)
PIP_CMD := pip
PIP_COMPILE := pip-compile
PIP_SYNC := pip-sync --pip-args "--no-deps"
else
PIP_CMD := uv
PIP_COMPILE := $(UV_TOOL) pip compile
PIP_SYNC := $(UV_TOOL) pip sync
endif
build-venv:
pew new -p=$(PYTHON_VERSION) -c $(PIP_CMD) -a . -r requirements.txt $(VENV_NAME)
lock: requirements.txt
sync:
pew in $(VENV_NAME) $(PIP_SYNC) requirements.txt
runserver:
pew in $(VENV_NAME) python manage.py runserver
test:
pew in $(VENV_NAME) pytest .
django-check:
pew in $(VENV_NAME) python manage.py check
black:
pew in $(VENV_NAME) black .
ruff-check:
ruff check .
ruff-fix:
ruff check --fix .
bandit:
bandit -c pyproject.toml -r .
%.txt: %.in
pew in $(VENV_NAME) $(PIP_COMPILE) --generate-hashes --output-file $@ $<
.PHONY: lock sync build-venv runserver test django-check black ruff-check ruff-fix bandit