-
Notifications
You must be signed in to change notification settings - Fork 2
/
tasks.py
35 lines (23 loc) · 888 Bytes
/
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
# 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 lint(context):
subprocess.run(f"mypy {ROOT}", shell=True, check=False)
subprocess.run(f"pylint {ROOT}/roboswag", 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)
@task
def docs(context):
subprocess.run("sphinx-build -b html docs/source docs/_build/", shell=True)
@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)