-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (59 loc) · 1.31 KB
/
Makefile
File metadata and controls
76 lines (59 loc) · 1.31 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
68
69
70
71
72
73
74
75
76
VENV_BIN ?= ./infinity_env/bin
PYLINTHOME ?= .pylint.d
export PYLINTHOME
ifneq (,$(wildcard $(VENV_BIN)/black))
BLACK := $(VENV_BIN)/black
else
BLACK := black
endif
ifneq (,$(wildcard $(VENV_BIN)/ruff))
RUFF := $(VENV_BIN)/ruff
else
RUFF := ruff
endif
ifneq (,$(wildcard $(VENV_BIN)/flake8))
FLAKE8 := $(VENV_BIN)/flake8
else
FLAKE8 := flake8
endif
ifneq (,$(wildcard $(VENV_BIN)/pylint))
PYLINT := $(VENV_BIN)/pylint
else
PYLINT := pylint
endif
ifneq (,$(wildcard $(VENV_BIN)/pytest))
PYTEST := $(VENV_BIN)/pytest
else
PYTEST := python3 -m pytest
endif
ifneq (,$(wildcard $(VENV_BIN)/uvicorn))
UVICORN := $(VENV_BIN)/uvicorn
else
UVICORN := python3 -m uvicorn
endif
format: black ruff
lint: flake8 pylint
black:
$(BLACK) ./src || true
$(BLACK) ./tests || true
flake8:
$(FLAKE8) --ignore E501,E402,F401,W503,C0414 ./src || true
$(FLAKE8) --ignore E501,E402,F401,W503,C0414 ./tests || true
pylint:
@mkdir -p $(PYLINTHOME)
$(PYLINT) ./src || true
$(PYLINT) ./tests || true
ruff:
$(RUFF) check --fix ./src || true
$(RUFF) check --fix ./tests || true
test:
$(PYTEST) .
dev:
$(UVICORN) src:app --reload --port 3000 --loop uvloop
clean:
docker stop infinity-api
docker rm infinity-api
docker system prune -fa
build:
docker build -t infinity-api . --no-cache
.PHONY: black flake8 pylint test dev clean build ruff format