-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
110 lines (76 loc) · 1.56 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
PYTHON_TEST_COMMAND=pytest -s
DEL_COMMAND=gio trash
SYNC=--sync
# Install
upgrade-pip:
pip install --upgrade pip
install-ci: upgrade-pip
pip install poetry==1.8.3
poetry config virtualenvs.create false
install-run:
poetry install --only main
install-test:
poetry install --only main --only test
install-lint:
poetry install --only lint
install-dev: upgrade-pip
poetry install $(SYNC)
pre-commit install
install: lock-check install-dev lint cover
# Poetry
lock:
poetry lock --no-update
lock-check:
poetry check --lock
lock-export: lock-check
poetry export -f requirements.txt --output requirements.lock --only main --without-hashes
artifacts: lock-export
# Test
test:
export ENV_FOR_DYNACONF=test; \
export TELEGRAM_TOKEN="123:ABC"; \
python -m $(PYTHON_TEST_COMMAND)
cover:
export ENV_FOR_DYNACONF=test; \
export TELEGRAM_TOKEN="123:ABC"; \
coverage run -m $(PYTHON_TEST_COMMAND)
coverage html
xdg-open htmlcov/index.html > /dev/null 2>&1 &
$(DEL_COMMAND) .coverage*
# Lint
format:
black .
isort .
ruff check . --fix
check-ruff:
ruff check .
check-black:
black --check .
check-isort:
isort --check .
check-mypy:
mypy app/
lint: format
pre-commit run --all-files
# Run
run:
@make kill --no-print-directory
python -m telegram_bot.main
kill:
killall python || true
# Deploy
update:
cd tf; make update;
plan:
cd tf; make plan;
apply:
cd tf; make apply;
deploy:
cd tf; make deploy;
# Quick and dirty
wip: format
git add .
git commit -m "Auto commit" --no-verify
amend: format
git add .
git commit --amend --no-edit --no-verify