-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
97 lines (75 loc) · 2.42 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
OPEN=xdg-open
ROOT_DIR=$(shell pwd)/
PROJECT_DIR=$(ROOT_DIR)/
TEST_DIR=$(ROOT_DIR)/tests
TRANSLATION_FILE=$(ROOT_DIR)/translation.py
TELEGRAM_DIR=$(ROOT_DIR)/telegram_uk_cs_translation_bot
TELEGRAM_PACKAGE=$(ROOT_DIR)/telegram_uk_cs_translation_bot.zip
MESSENGER_DIR=$(ROOT_DIR)/messenger_uk_cs_translation_bot
MESSENGER_PACKAGE=$(ROOT_DIR)/messenger_uk_cs_translation_bot.zip
VIBER_DIR=$(ROOT_DIR)/viber_uk_cs_translation_bot
VIBER_PACKAGE=$(ROOT_DIR)/viber_uk_cs_translation_bot.zip
checks: mypy test
mypy:
mypy $(PROJECT_DIR) $(TEST_DIR)
test: test-ci
test-ci:
pytest \
--cov=$(PROJECT_DIR) \
-v \
--ignore $(TELEGRAM_DIR) \
--ignore $(MESSENGER_DIR) \
--ignore $(VIBER_DIR)
coverage:
coverage html -d coverage_html
$(OPEN) coverage_html/index.html
test-and-coverage: test coverage
pre-commit-all:
pre-commit run -a -v || git diff
pre-commit-install:
pre-commit install
install-all: dep-install pre-commit-install
dep-install: dep-install-run dep-install-dev external-install
dep-install-run:
pip install -r requirements.txt
dep-install-dev:
pip install -r requirements-dev.txt
external-install:
pip install -r $(TELEGRAM_DIR)/requirements.txt
pack-all: pack-telegram pack-messenger pack-viber
pack-telegram:
cd $(TELEGRAM_DIR); \
rm -rfv $(TELEGRAM_PACKAGE) package; \
echo "# COPY - DO NOT MODIFY " > t_translation.py; \
cat $(TRANSLATION_FILE) >> t_translation.py; \
pip install --target ./package --requirement requirements.txt; \
cd package; \
find . -name '__pycache__' -exec rm -rfv {} \;; \
zip -r $(TELEGRAM_PACKAGE) .; \
cd ..; \
zip -g $(TELEGRAM_PACKAGE) *.py; \
ls -l $(TELEGRAM_PACKAGE)
pack-messenger:
cd $(MESSENGER_DIR); \
rm -rfv $(MESSENGER_PACKAGE) package; \
echo "# COPY - DO NOT MODIFY " > m_translation.py; \
cat $(TRANSLATION_FILE) >> m_translation.py; \
pip install --target ./package --requirement requirements.txt; \
cd package; \
find . -name '__pycache__' -exec rm -rfv {} \;; \
zip -r $(MESSENGER_PACKAGE) .; \
cd ..; \
zip -g $(MESSENGER_PACKAGE) *.py; \
ls -l $(MESSENGER_PACKAGE)
pack-viber:
cd $(VIBER_DIR); \
rm -rfv $(VIBER_PACKAGE) package; \
echo "# COPY - DO NOT MODIFY " > v_translation.py; \
cat $(TRANSLATION_FILE) >> v_translation.py; \
pip install --target ./package --requirement requirements.txt; \
cd package; \
find . -name '__pycache__' -exec rm -rfv {} \;; \
zip -r $(VIBER_PACKAGE) .; \
cd ..; \
zip -g $(VIBER_PACKAGE) *.py; \
ls -l $(VIBER_PACKAGE)