1010 PIP_BIN : " {{ .VENV_DIR }}/bin/pip3"
1111 PYTEST_BIN : " {{ .VENV_DIR }}/bin/pytest"
1212 PYLINT_BIN : " {{ .VENV_DIR }}/bin/pylint"
13+ BLACK_BIN : " {{ .VENV_DIR }}/bin/black"
1314 TWINE_BIN : " {{ .VENV_DIR }}/bin/twine"
1415 FLEM_BIN : " {{ .VENV_DIR }}/bin/laflem"
16+ COVERAGE_BIN : " {{ .VENV_DIR }}/bin/coverage"
1517
1618tasks :
1719 venv :
8688 deps : [ venv, install-dev ]
8789 desc : Build and compile the application
8890 cmds :
91+ - rm -rf dist
8992 - >
9093 {{ .PYTHON_BIN }}
9194 -m build
@@ -112,6 +115,13 @@ tasks:
112115 deps : [ venv, install-dev, check_folder ]
113116 desc : Run pylint on the application
114117 cmds :
118+ - >
119+ {{ .BLACK_BIN }}
120+ --check
121+ lib setup.py
122+ |
123+ tee
124+ "{{ .CHECKS_DIR }}/black.result.txt"
115125 - >
116126 {{ .PYLINT_BIN }}
117127 lib setup.py
@@ -123,6 +133,7 @@ tasks:
123133 - tests/**/*
124134 - setup.py
125135 generates :
136+ - " {{ .CHECKS_DIR }}/black.result.txt"
126137 - " {{ .CHECKS_DIR }}/pylint.result.txt"
127138
128139 test :
@@ -133,11 +144,34 @@ tasks:
133144 vars :
134145 PACKAGE : dist/{{ .NAME }}-*.tar.gz
135146 - >
136- {{ .PYTEST_BIN }}
137- tests
147+ {{ .PYTHON_BIN }}
148+ -m pytest
149+ -v
150+ -n 4
151+ --cov={{ .NAME }}
152+ --junitxml="{{ .CHECKS_DIR }}/result.xml"
153+ --html="{{ .CHECKS_DIR }}/report.html"
154+ "tests/{{ .NAME }}"
155+ - >
156+ {{ .COVERAGE_BIN }}
157+ html
158+ -d "{{ .CHECKS_DIR }}/htmlcov"
159+ - >
160+ {{ .COVERAGE_BIN }}
161+ xml
162+ -o "{{ .CHECKS_DIR }}/coverage.xml"
138163 - task : uninstall-package
139164 vars :
140165 PACKAGE : " {{ .NAME }}"
166+ # - open "{{ .CHECKS_DIR }}/report.html"
167+ # - open "{{ .CHECKS_DIR }}/htmlcov/index.html"
168+ sources :
169+ - lib/**/*
170+ - tests/**/*
171+ - setup.py
172+ generates :
173+ - " {{ .CHECKS_DIR }}/result.xml"
174+ - " {{ .CHECKS_DIR }}/coverate.xml"
141175
142176 package_check :
143177 internal : true
@@ -192,6 +226,7 @@ tasks:
192226 lib/*.egg-info
193227 "{{ .CHECKS_DIR }}"
194228 .pytest_cache
229+ .coverage
195230
196231 run-dev :
197232 deps : [ install ]
0 commit comments