1
- .PHONY : clean clean-test clean-pyc clean-build docs help
1
+ .PHONY : clean clean-test clean-pyc clean-build help
2
2
.DEFAULT_GOAL := help
3
3
define BROWSER_PYSCRIPT
4
4
import os, webbrowser, sys
@@ -21,69 +21,102 @@ for line in sys.stdin:
21
21
print("%-20s %s" % (target, help))
22
22
endef
23
23
export PRINT_HELP_PYSCRIPT
24
+
24
25
BROWSER := python -c "$$BROWSER_PYSCRIPT"
26
+ VERSION =$(shell grep __version__ learnregex/__init__.py)
27
+ REQUIREMENTS ="requirements_dev.pip"
28
+ TAG ="\n\n\033[0;32m\# \#\# "
29
+ END=" \# \#\# \033[0m\n"
30
+
31
+ all : test
25
32
26
33
help :
27
34
@python -c " $$ PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST )
28
35
29
36
clean : clean-build clean-pyc clean-test # # remove all build, test, coverage and Python artifacts
30
37
31
-
32
- clean-build : # # remove build artifacts
38
+ clean-build :
39
+ @echo $( TAG ) Remove build artifacts$( END )
33
40
rm -fr build/
34
41
rm -fr dist/
35
42
rm -fr .eggs/
36
43
find . -name ' *.egg-info' -exec rm -fr {} +
37
44
find . -name ' *.egg' -exec rm -f {} +
45
+ @echo
38
46
39
- clean-pyc : # # remove Python file artifacts
47
+ clean-pyc :
48
+ @echo $(TAG ) Remove Python file artifacts$(END )
40
49
find . -name ' *.pyc' -exec rm -f {} +
41
50
find . -name ' *.pyo' -exec rm -f {} +
42
51
find . -name ' *~' -exec rm -f {} +
43
52
find . -name ' __pycache__' -exec rm -fr {} +
53
+ @echo
44
54
45
- clean-test : # # remove test and coverage artifacts
55
+ clean-test :
56
+ @echo $(TAG ) Remove test and coverage artifacts$(END )
46
57
rm -fr .tox/
47
58
rm -f .coverage
48
59
rm -fr htmlcov/
60
+ @echo
49
61
50
- lint : # # check style with flake8
62
+ lint :
63
+ @echo $(TAG ) Remove test and coverage artifacts$(END )
51
64
flake8 learnregex tests
52
-
53
- test : # # run tests quickly with the default Python
54
-
55
- python setup.py test
56
-
57
- test-all : # # run tests on every Python version with tox
65
+ @echo
66
+
67
+ msg-init :
68
+ @echo $(TAG ) Initializing messages$(END )
69
+ pybabel init -D pyschool -i learnregex/locale/learnregex.pot -d learnregex/locale -l en
70
+ pybabel init -D pyschool -i learnregex/locale/learnregex.pot -d learnregex/locale -l es
71
+ @echo
72
+
73
+ msg-extract :
74
+ @echo $(TAG ) Extracting messages$(END )
75
+ pybabel extract -o learnregex/locale/learnregex.pot learnregex
76
+ pybabel update -D pyschool -i learnregex/locale/learnregex.pot -d learnregex/locale -l en
77
+ pybabel update -D pyschool -i learnregex/locale/learnregex.pot -d learnregex/locale -l es
78
+ @echo
79
+
80
+ msg-compile :
81
+ @echo $(TAG ) Compiling messages$(END )
82
+ pybabel compile -D pyschool -d learnregex/locale -f --statistics
83
+ @echo
84
+
85
+ msg : msg-extract msg-compile
86
+
87
+ test :
88
+ @echo $(TAG ) Run tests quickly with the default Python$(END )
89
+ PYTHONPATH=. py.test ./tests
90
+ @echo
91
+
92
+ test-all :
93
+ @echo $(TAG ) Run tests on every Python version with tox$(END )
58
94
tox
95
+ @echo
96
+
97
+ coverage :
98
+ @echo $(TAG ) Check code coverage quickly with the default Python$(END )
99
+ coverage run --source learnregex -m pytest
59
100
60
- coverage : # # check code coverage quickly with the default Python
61
-
62
- coverage run --source learnregex setup.py test
63
-
64
101
coverage report -m
65
102
coverage html
66
103
$(BROWSER) htmlcov/index.html
104
+ @echo
67
105
68
- docs : # # generate Sphinx HTML documentation, including API docs
69
- rm -f docs/learnregex.rst
70
- rm -f docs/modules.rst
71
- sphinx-apidoc -o docs/ learnregex
72
- $(MAKE ) -C docs clean
73
- $(MAKE ) -C docs html
74
- $(BROWSER ) docs/_build/html/index.html
75
-
76
- servedocs : docs # # compile the docs watching for changes
77
- watchmedo shell-command -p ' *.rst' -c ' $(MAKE) -C docs html' -R -D .
78
-
79
- release : clean # # package and upload a release
106
+ release : clean
107
+ @echo $(TAG ) Package and upload a release$(END )
80
108
python setup.py sdist upload
81
109
python setup.py bdist_wheel upload
110
+ @echo
82
111
83
- dist : clean # # builds source and wheel package
112
+ dist : clean
113
+ @echo $(TAG ) Builds source and wheel package$(END )
84
114
python setup.py sdist
85
115
python setup.py bdist_wheel
86
116
ls -l dist
117
+ @echo
87
118
88
- install : clean # # install the package to the active Python's site-packages
119
+ install : clean
120
+ @echo $(TAG ) Install the package to the active Python site-packages$(END )
89
121
python setup.py install
122
+ @echo
0 commit comments