-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (63 loc) · 3.11 KB
/
Makefile
File metadata and controls
77 lines (63 loc) · 3.11 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
77
# Copyright (c) 2019-2026 Alexander Todorov <atodorov@otb.bg>
#
# 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 --index-url https://$(PKG_TOKEN)@pkg.kiwitcms.eu/pypi/ --extra-index-url https://pypi.org/simple/; \
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; --index-url https://$(PKG_TOKEN)@pkg.kiwitcms.eu/pypi/ --extra-index-url https://pypi.org/simple/; \
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; --index-url https://$(PKG_TOKEN)@pkg.kiwitcms.eu/pypi/ --extra-index-url https://pypi.org/simple/; \
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 @
.PHONY: package
package:
rm -rf build/ dist/ kiwitcms_*.egg-info/
python setup.py sdist
python setup.py bdist_wheel
twine check dist/*
.PHONY: upload
upload: package
test -n "$(TWINE_USERNAME)" || exit 1
test -n "$(TWINE_PASSWORD)" || exit 2
twine upload dist/* --repository-url https://push.fury.io/kiwitcms