-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.py
81 lines (45 loc) · 1.32 KB
/
Makefile.py
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
import pipepy
from pipepy import python, rm
pipepy.set_always_stream(True)
pipepy.set_always_raise(True)
DEFAULT_PYMAKE_TARGET = "watchtest"
def test():
"""Run tests"""
from pipepy import pytest
pytest()
def covtest():
"""Run tests and produce coverge report"""
from pipepy import pytest
pytest(cov="src/pipepy", cov_report="term-missing")()
def html(covtest):
"""Run tests and open coverage report in browser"""
from pipepy import coverage, xdg_open
coverage.html()
xdg_open("htmlcov/index.html")()
def watchtest():
"""Automatically run tests when a source file changes"""
from pipepy import pytest_watch
pytest_watch()
def debugtest():
"""Run tests without capturing their output. This makes using an
interactive debugger possible
"""
from pipepy import pytest
s = "s"
cmd = pytest - s # noqa: E225
cmd()
def checks():
"""Run static checks on the code (flake8, isort)"""
from pipepy import black, flake8, isort
flake8()
isort(".", check_only=True)()
black(".")
def clean():
"""Clean up build directories"""
rm("-rf", "build", "dist")()
def build(clean):
"""Build package"""
python("-m", "build")()
def publish(build):
"""Publish package to PyPI"""
python("-m", "twine").upload("dist/*")()