-
Notifications
You must be signed in to change notification settings - Fork 2
/
tasks.py
50 lines (38 loc) · 1.29 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
# pylint: disable=missing-function-docstring, unused-argument
import pathlib
import subprocess
from invoke import task
ROOT = pathlib.Path(__file__).parent.resolve().as_posix()
@task
def tests(context):
cmd = [
"python",
"-m",
"robot",
f"--variable=root:{ROOT}",
f"--outputdir={ROOT}/tests/logs",
"--loglevel=TRACE:DEBUG",
f"{ROOT}/tests/suites",
]
subprocess.run(" ".join(cmd), shell=True, check=False)
@task
def lint(context):
subprocess.run(f"mypy {ROOT}", shell=True, check=False)
subprocess.run(
f"pylint {ROOT}/flat/Flat {ROOT}/nested/Nested {ROOT}/split/Global {ROOT}/split/Shop {ROOT}/split/UserGuide",
shell=True,
check=False,
)
subprocess.run(f"robocop {ROOT}", shell=True, check=False)
@task
def format_code(context):
subprocess.run(f"black {ROOT}", shell=True, check=False)
subprocess.run(f"isort {ROOT}", shell=True, check=False)
subprocess.run(f"robotidy {ROOT}", shell=True, check=False)
@task(format_code)
def build(context):
subprocess.run("poetry build", shell=True, check=False)
@task(post=[build])
def bump_version(context, rule):
subprocess.run(f"poetry version {rule}", shell=True, check=False)
subprocess.run("poetry install", shell=True, check=False)