-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
44 lines (28 loc) · 846 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
38
39
40
41
42
43
44
from invoke import task
def black(c, check):
cmd = f"black . --line-length=79 {'--check' if check is True else ''}"
return c.run(cmd)
@task(aliases=["f"])
def format(c):
return black(c, False)
@task(aliases=["cf", "fc"])
def check_format(c):
return black(c, True)
@task(aliases=["l", "lp"])
def lint(c):
return c.run("pycodestyle . --max-line-length=100")
@task(aliases=["t"])
def test_and_cover(c):
c.run("coverage run -m pytest --junitxml=junit.xml")
return c.run("coverage xml")
@task(aliases=["c"])
def clean(c):
return c.run("rm -rf dist bails_lambda_utils.egg-info build")
@task(aliases=["b"])
def build(c):
return c.run("python setup.py bdist_wheel")
@task(aliases=["bp"])
def build_and_publish(c):
clean()
build()
return c.run("python -m twine upload dist/*.whl --verbose")