-
Notifications
You must be signed in to change notification settings - Fork 2
/
tasks.py
49 lines (35 loc) · 1.16 KB
/
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
45
46
47
48
import sys
import invoke
ARTIFACTS = (
'*.egg-info',
'.hypothesis',
'build',
'dist',
'src/*.so'
)
@invoke.task
def clean(context):
'''Clean doc and build artifacts
'''
cmd = f'{sys.executable} -m pip --disable-pip-version-check uninstall --yes arraykit'
context.run(cmd, echo=True, pty=True)
for artifact in sorted(ARTIFACTS):
context.run(f'rm -rf {artifact}', echo=True, pty=True)
@invoke.task(clean)
def build(context):
# context.run('pip install -r requirements-test.txt', echo=True, pty=True)
# keep verbose to see warnings
context.run(f'{sys.executable} -m pip --disable-pip-version-check -v install .', echo=True, pty=True)
@invoke.task(build)
def test(context):
cmd = 'pytest -s --disable-pytest-warnings --tb=native'
context.run(cmd, echo=True, pty=True)
@invoke.task(build)
def performance(context, names=''):
context.run(f'{sys.executable} -m performance {"--names" if names else ""} {names}', echo=True, pty=True)
@invoke.task
def lint(context):
'''Run pylint static analysis.
'''
cmd = 'pylint -f colorized *.py performance src test'
context.run(cmd, echo=True, pty=True)