This repository has been archived by the owner on Jul 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (65 loc) · 2.04 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
# Copyleft (ɔ) 2021 Mauko Quiroga <[email protected]>
#
# Licensed under the EUPL-1.2-or-later
# For details: https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
.DEFAULT_GOAL := all
all: format bind lint type test ;
%:
@${MAKE} bind-$*
@${MAKE} lint-$*
@${MAKE} type-$*
@${MAKE} test-$*
install:
@python -m pip install --upgrade pip wheel setuptools
@python -m pip install --upgrade nox-poetry
@python -m pip install --upgrade poetry
@python -m pip install --upgrade nox
compile: src
@poetry run python -m compileall -q $?
clean: src
@rm -rf $(shell find $? -name "*.pyc")
format: $(shell git ls-files "*.py")
@poetry run isort $?
@poetry run autopep8 $?
@poetry run pyupgrade $? --py36-plus --keep-runtime-typing
bind: compile clean
@poetry run python -m deal test --count=25 src
bind-%: compile clean
@poetry run python -m deal test --count=100 src/$*
lint: compile clean
@poetry run flake8 docs/conf.py src tests noxfile.py
@poetry run sphinx-build -b dummy -anqTW docs docs/_build
lint-%: compile clean
@poetry run flake8 src/$*
type: compile clean
@poetry run mypy docs/conf.py src noxfile.py
@poetry run pytype docs/conf.py src noxfile.py
type-%: compile clean
@poetry run mypy src/$*
@poetry run pytype src/$*
test: export COLUMNS = 200
test: compile clean
@poetry run pytest --cov
@poetry run robot --outputdir .robot tests/functional
@poetry run interrogate src
@poetry run sphinx-build -b doctest -anqTW docs docs/_build
test-%: export COLUMNS = 200
test-%: compile clean
@poetry run pytest src/$*
@poetry run interrogate src/$*
tag-version:
@poetry version --short | xargs -I \{\} git tag \{\}
@git push --tags
bump-version:
@poetry run pip uninstall mantic -y -q
@poetry install -q
@poetry run mantic check-version \
|| { \
exit_code=$${?} ; \
version=( "" "patch" "minor" "major" ) ; \
poetry version $${version[$${exit_code}]} -q ; \
poetry install -q ; \
git add -A ; \
poetry version --short | xargs -I \{\} git commit -m "Bump version to {}" ; \
git push origin $(shell git branch --show-current) ; \
}