-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
47 lines (40 loc) · 1.21 KB
/
tasks.py
File metadata and controls
47 lines (40 loc) · 1.21 KB
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
from invoke import task
from sys import platform
from subprocess import call
@task
def start(ctx):
if platform == "win32":
ctx.run("python ./characters/characters.py")
else:
ctx.run("python characters/characters.py", pty=True)
@task
def build(ctx):
if platform == "win32":
ctx.run("python ./characters/build.py")
else:
ctx.run("python characters/build.py", pty=True)
@task
def test(ctx):
if platform == "win32":
ctx.run("pytest characters --ignore=characters/ui")
else:
ctx.run("pytest characters --ignore=characters/ui", pty=True)
@task
def coverage(ctx):
if platform == "win32":
ctx.run("coverage run --branch -m pytest characters --ignore-glob=**/ui/* -c .coveragerc")
else:
ctx.run("coverage run --branch -m pytest characters --ignore-glob=**/ui/* -c .coveragerc", pty=True)
@task(coverage)
def coverage_report(ctx):
if platform != "win32":
ctx.run("coverage html", pty=True)
call(("xdg-open", "htmlcov/index.html"))
else:
ctx.run("coverage html")
@task
def lint(ctx):
ctx.run("pylint --recursive=true characters")
@task
def format(ctx):
ctx.run("autopep8 --in-place --recursive characters")