-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
53 lines (41 loc) · 1022 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
VENV=.venv
SHELL=/bin/bash
python=$(VENV)/bin/python3
uv?=uv
# Utility scripts to prettify echo outputs
bold := '\033[1m'
sgr0 := '\033[0m'
.PHONY: bootstrap
bootstrap: venv update
.PHONY: clean
clean:
@echo -e $(bold)Clean up old virtualenv and cache$(sgr0)
rm -rf $(VENV) *.egg-info
.PHONY: venv
venv: clean
@echo -e $(bold)Create virtualenv$(sgr0)
@$(uv) venv --python 3.12 $(VENV)
.PHONY: envfile
envfile:
cp .env.default .env
.PHONY: update
update:
@echo -e $(bold)Install and update requirements$(sgr0)
$(uv) pip sync requirements.dev.txt
$(uv) pip install --editable .
.PHONY: requirements
requirements:
$(uv) pip compile --universal --upgrade \
--output-file requirements.txt pyproject.toml
$(uv) pip compile --universal --upgrade --extra dev \
--output-file requirements.dev.txt pyproject.toml
.PHONY: lint
lint:
$(VENV)/bin/black **/*.py
$(VENV)/bin/isort **/*.py
.PHONY: test
test:
$(python) -m pytest -x -p no:warnings
.PHONY: db
db:
docker compose -f docker-compose.yaml up -d