-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (54 loc) · 1.67 KB
/
Copy pathMakefile
File metadata and controls
67 lines (54 loc) · 1.67 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.PHONY: clean install formatter lint types static-checks test up down setup_services start_app gen-requirements
help:
@echo "make"
@echo " clean"
@echo " Remove Python/build artifacts."
@echo " install"
@echo " Create a virtual environment and install dependencies."
@echo " formatter"
@echo " Apply ruff formatting to code."
@echo " lint"
@echo " Lint code with ruff, and check if ruff formatter should be applied."
@echo " types"
@echo " Check for type errors using mypy."
@echo " static-checks"
@echo " Run all python static checks."
@echo " test"
@echo " Run pytest on tests/."
@echo " up"
@echo " Start the services and the gunicorn server"
@echo " down"
@echo " Stop the services"
@echo " setup_services"
@echo " Setup required services using tox."
@echo " start_app"
@echo " Start the gunicorn server."
@echo " gen-requirements"
@echo " Generate requirements.txt from uv.lock for deployment."
clean:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
rm -rf .mypy_cache/
rm -rf .venv/
install:
uv sync --group dev
formatter:
tox -e autoformat
format: formatter
lint:
tox -e py312-lint
types:
tox -e py312-mypy
static-checks: lint types
test:
tox -e py312-test
up: setup_services start_app
setup_services:
tox -e setup_services
start_app:
uv run gunicorn --bind 127.0.0.1:8000 --worker-class aiohttp.GunicornWebWorker --reload pyslackersweb:app_factory
down:
tox -e teardown_services
gen-requirements:
uv export --no-hashes --format requirements-txt > requirements.txt