-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtasks.py
40 lines (29 loc) · 938 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
import functools
import sys
import invoke
run = functools.partial(invoke.Context.run, echo=True, pty=True)
@invoke.task
def install(context):
run(
context,
f"{sys.executable} -m pip --disable-pip-version-check install --upgrade pip",
)
run(
context,
f"{sys.executable} -m pip --disable-pip-version-check install --upgrade -r requirements.txt",
)
@invoke.task()
def clean(context):
run(
context,
f"{sys.executable} -m pip --disable-pip-version-check uninstall --yes arraymap",
)
for artifact in ("*.egg-info", "*.so", "build", "dist"):
run(context, f"rm -rf {artifact}")
run(context, f"{sys.executable} -m black --quiet .")
@invoke.task(clean)
def build(context):
run(context, f"{sys.executable} -m pip --disable-pip-version-check -v install .")
@invoke.task(build)
def test(context):
run(context, f"{sys.executable} -m pytest -s")