-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
37 lines (27 loc) · 809 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
36
37
import os
from invoke import task
PYWARN = "python -Wd"
@task
def clean(ctx):
"""Remove build artifacts"""
ctx.run("rm -rf .cache build prolog.egg-info .coverage htmlcov")
@task
def develop(ctx):
"""Install development requirements"""
ctx.run("pip install -U pip", pty=True)
ctx.run("pip install -e .", pty=True)
ctx.run("pip install -r test-requirements.txt", pty=True)
@task
def test(ctx, show=False, test=None):
"""Run tests and coverage"""
ctx.run(
"pytest --cov-config .coveragerc --cov-report html --cov-report term --cov=prolog",
pty=True,
)
if show:
cov(ctx)
@task
def cov(ctx):
"""Open the coverage reports"""
if os.path.exists("build/coverage/index.html"):
ctx.run("open build/coverage/index.html", pty=True)