-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
63 lines (52 loc) · 2.51 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
# Copyright (c) 2019-2023 Alexander Todorov <[email protected]>
#
# Licensed under GNU Affero General Public License v3 or later (AGPLv3+)
# https://www.gnu.org/licenses/agpl-3.0.html
KIWI_INCLUDE_PATH=../Kiwi
PATH_TO_SITE_PACKAGES = $(shell python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')
.PHONY: test
test:
if [ ! -d "$(KIWI_INCLUDE_PATH)/kiwi_lint" ]; then \
git clone --depth 1 https://github.com/kiwitcms/Kiwi.git $(KIWI_INCLUDE_PATH); \
pip install -U -r $(KIWI_INCLUDE_PATH)/requirements/base.txt; \
pip install -U -r requirements.txt; \
rm -rf $(PATH_TO_SITE_PACKAGES)/test_project; \
fi
PYTHONPATH=.:$(KIWI_INCLUDE_PATH) PYTHONWARNINGS=d EXECUTOR=standard AUTO_CREATE_SCHEMA='' \
KIWI_TENANTS_DOMAIN="example.org" coverage run \
--include "tcms_github_app/*.py" \
--omit "tcms_github_app/tests/*.py" \
./manage.py test -v2 tcms_github_app.tests
FLAKE8_EXCLUDE=.git
.PHONY: flake8
flake8:
# ignore "line too long"
@flake8 --exclude=$(FLAKE8_EXCLUDE) --ignore=E501 tcms_github_app/
.PHONY: pylint
pylint:
if [ ! -d "$(KIWI_INCLUDE_PATH)/kiwi_lint" ]; then \
git clone --depth 1 https://github.com/kiwitcms/Kiwi.git $(KIWI_INCLUDE_PATH); \
pip install -U -r $(KIWI_INCLUDE_PATH)/requirements/base.txt; \
pip install -U -r requirements.txt; \
rm -rf $(PATH_TO_SITE_PACKAGES)/test_project; \
fi
PYTHONPATH=.:$(KIWI_INCLUDE_PATH) DJANGO_SETTINGS_MODULE="test_project.settings" \
pylint --load-plugins=pylint_django --load-plugins=kiwi_lint -d similar-string \
-d missing-docstring -d duplicate-code -d module-in-directory-without-init \
*.py tcms_github_app/ test_project/ tcms_settings_dir/
.PHONY: test_for_missing_migrations
test_for_missing_migrations:
if [ ! -d "$(KIWI_INCLUDE_PATH)/kiwi_lint" ]; then \
git clone --depth 1 https://github.com/kiwitcms/Kiwi.git $(KIWI_INCLUDE_PATH); \
pip install -U -r $(KIWI_INCLUDE_PATH)/requirements/base.txt; \
pip install -U -r requirements.txt; \
rm -rf $(PATH_TO_SITE_PACKAGES)/test_project; \
fi
PYTHONPATH=.:$(KIWI_INCLUDE_PATH) KIWI_TENANTS_DOMAIN="example.org" ./manage.py migrate
PYTHONPATH=.:$(KIWI_INCLUDE_PATH) KIWI_TENANTS_DOMAIN="example.org" ./manage.py makemigrations --check
.PHONY: check
check: flake8 pylint test_for_missing_migrations test
.PHONY: messages
messages:
./manage.py makemessages --locale en --no-obsolete --no-vinaigrette --ignore "test*.py"
ls tcms_github_app/locale/*/LC_MESSAGES/*.po | xargs -n 1 -I @ msgattrib -o @ --no-fuzzy @