-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
55 lines (42 loc) · 1.01 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
SHELL := /usr/bin/env bash -O globstar
PWD := $(shell pwd)
run:
docker run -it --rm --init -p 8000:8000 \
-v $(PWD)/codebox:/app/codebox \
--ipc=none \
--privileged \
--name codebox codebox \
hypercorn --reload --config=hypercorn.toml "codebox.main:app"
# use dev to manually run tests in the container
dev:
docker run -it --rm --init -e ENV=testing -p 8000:8000 \
-v $(PWD)/codebox:/app/codebox \
-v $(PWD)/tests:/app/tests \
--ipc=none \
--privileged \
--name codebox codebox bash
lint:
@echo
ruff check --diff .
@echo
ruff format --diff .
@echo
mypy .
format:
ruff --silent --exit-zero --fix .
ruff format .
audit:
pip-audit
build:
docker build -t codebox .
test:
docker run --rm --init -e ENV=testing -p 8000:8000 \
-v $(PWD)/codebox:/app/codebox \
-v $(PWD)/tests:/app/tests \
--ipc=none \
--privileged \
--name codebox codebox \
pytest -x --cov-report term-missing \
--cov-report html --cov-branch --cov codebox/
install_hooks:
@ scripts/install_hooks.sh