-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.py
68 lines (49 loc) · 1.64 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
68
from invoke import task
@task
def lint_python(c):
"""Perform python code formatting with black, isort and flake8."""
print("Linting python code with black, isort, flake8 and mypy...")
c.run("black ./setup.py ./tasks.py Mainframe3270/ atest/ utest/")
c.run("isort ./setup.py ./tasks.py Mainframe3270/ atest/ utest/")
c.run("flake8 ./setup.py ./tasks.py Mainframe3270/ atest/ utest/")
c.run("mypy ./setup.py ./tasks.py Mainframe3270/")
@task
def lint_robot(c):
"""Perform robot code formatting with robotidy."""
print("Lingting Robot Framework code with robotidy...")
c.run("robotidy atest/")
@task(lint_python, lint_robot)
def lint(c):
"""
Perform code formatting for both robot and python code.
Short option for `inv lint-python && inv lint-robot`.
"""
pass
@task
def utest(c):
"""Runs python unit tests."""
c.run("pytest utest/")
@task
def atest(c):
"""Runs robot acceptance tests."""
c.run("robot --loglevel DEBUG atest/")
@task(utest, atest)
def test(c):
"""Runs unit and acceptance tests.
Short option for `inv utest && inv atest`.
"""
pass
@task
def build_release(c):
"""Build a source and binary distro for the project.
Manual steps to take before running this command is to change the version
in `Mainframe3270/version.py`.
"""
c.run("python -m build")
@task
def kw_docs(c):
"""Generates the keyword documentation with libdoc.
Creates a html and a xml file and places them under doc/.
"""
c.run("python -m robot.libdoc Mainframe3270/ doc/Mainframe3270.html")
c.run("python -m robot.libdoc Mainframe3270/ doc/Mainframe3270.xml")