Debian Codegraph @

Makefile

raw
1 # Some simple testing tasks (sorry, UNIX only).
2
3 FLAGS=
4
5 checkrst:
6 python -m twine check --strict dist/*
7
8
9 flake:checkrst
10 flake8 aiomysql tests examples
11
12 test: flake
13 py.test -s $(FLAGS) ./tests/
14
15 vtest:
16 py.test -s -v $(FLAGS) ./tests/
17
18
19 cov cover coverage: flake
20 py.test -s -v --cov-report term --cov-report html --cov aiomysql ./tests
21 @echo "open file://`pwd`/htmlcov/index.html"
22
23 clean:
24 rm -rf `find . -name __pycache__`
25 rm -f `find . -type f -name '*.py[co]' `
26 rm -f `find . -type f -name '*~' `
27 rm -f `find . -type f -name '.*~' `
28 rm -f `find . -type f -name '@*' `
29 rm -f `find . -type f -name '#*#' `
30 rm -f `find . -type f -name '*.orig' `
31 rm -f `find . -type f -name '*.rej' `
32 rm -f .coverage
33 rm -rf coverage
34 rm -rf build
35 rm -rf htmlcov
36 rm -rf dist
37
38 start_mysql:
39 @echo "----------------------------------------------------"
40 @echo "Starting mysql, see docker-compose.yml for user/pass"
41 @echo "----------------------------------------------------"
42 docker-compose -f docker-compose.yml up -d mysql
43
44 stop_mysql:
45 docker-compose -f docker-compose.yml stop mysql
46
47 # TODO: this depends on aiomysql being installed, e.g. in a venv.
48 # TODO: maybe this can be solved better.
49 doc:
50 @echo "----------------------------------------------------------------"
51 @echo "Doc builds require installing the aiomysql package in the"
52 @echo "environment. Make sure you've installed your current dev version"
53 @echo "into your environment, e.g. using venv, then run this command in"
54 @echo "the virtual environment."
55 @echo "----------------------------------------------------------------"
56 git fetch --tags --all
57 make -C docs html
58 @echo "open file://`pwd`/docs/_build/html/index.html"
59
60 .PHONY: all flake test vtest cov clean doc