-
Notifications
You must be signed in to change notification settings - Fork 158
/
Makefile
70 lines (57 loc) · 1.98 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
# Some simple testing tasks (sorry, UNIX only).
clean-docs:
cd docs && rm -rf _build/html
doc: clean-docs
cd docs && make html
@echo "open file://`pwd`/docs/_build/html/index.html"
isort:
isort --use-parentheses --multi-line 3 --combine-as --trailing-comma aiopg
isort --use-parentheses --multi-line 3 --combine-as --trailing-comma tests
isort --use-parentheses --multi-line 3 --combine-as --trailing-comma examples
black:
black --line-length 79 aiopg
black --line-length 79 tests
black --line-length 79 examples
lint: .lint
.lint: $(shell find aiopg -type f) \
$(shell find tests -type f) \
$(shell find examples -type f)
flake8 aiopg tests examples
python setup.py check -rms
@if ! black --line-length 79 --check aiopg tests examples; then \
echo "Format errors, run 'make black' to fix them!!!"; \
false; \
fi
@if ! isort --use-parentheses --multi-line 3 --combine-as --trailing-comma -c aiopg tests examples; then \
echo "Import sort errors, run 'make isort' to fix them!!!"; \
isort --diff aiopg tests examples; \
false; \
fi
@if ! mypy --strict --ignore-missing-imports --exclude sa aiopg; then \
echo "Typing errors"; \
false; \
fi
test: flake
pytest -q tests
vtest: flake
pytest tests
cov cover coverage: flake
py.test -svvv -rs --cov=aiopg --cov-report=html --cov-report=term tests
@echo "open file://`pwd`/htmlcov/index.html"
cov-ci: flake
py.test -svvv -rs --cov=aiopg --cov-report=term tests --pg_tag all
clean-pip:
pip freeze | grep -v "^-e" | xargs pip uninstall -y
clean:
find . -name __pycache__ |xargs rm -rf
find . -type f -name '*.py[co]' -delete
find . -type f -name '*~' -delete
find . -type f -name '.*~' -delete
find . -type f -name '@*' -delete
find . -type f -name '#*#' -delete
find . -type f -name '*.orig' -delete
find . -type f -name '*.rej' -delete
rm -f .coverage
rm -rf coverage
rm -rf docs/_build
.PHONY: all isort flake test vtest cov clean clean-pip clean-docs