-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
67 lines (53 loc) · 1.07 KB
/
tasks.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
from invoke import task, call
@task
def start(c):
"""
Run BDIO Brain
"""
print("Starting brain")
c.run("python bdio/brain/brain.py")
@task
def start_leaf(c):
"""
Run BDIO Leaf
"""
print("Starting leaf")
c.run("python bdio/leaf/leaf.py")
@task
def lint(c):
"""
Static analysis of code for programming issues
"""
print("Running flake8 linter")
c.run("flake8 bdio/ tasks.py", pty=True)
print()
@task
def format(c):
"""
Produce pep8 normative code output
"""
print("Running black formatter")
c.run("black bdio/ tasks.py", pty=True)
print()
@task
def test(c, coverage=False):
"""
Tests
"""
print("Running pytest")
if coverage:
c.run("pytest --cov=bdio", pty=True)
else:
c.run("pytest", pty=True)
print()
@task
def clean(c):
print("Running pyclean")
c.run("pyclean ./", pty=True)
print()
@task(pre=[format, lint, call(test, coverage=True)], post=[clean])
def build(c):
"""
Run all configured steps
"""
print("Build completed\n")