forked from termius/termius-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pavement.py
58 lines (43 loc) · 1.26 KB
/
pavement.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
49
50
51
52
53
54
55
56
57
58
# -*- coding: utf-8 -*-
"""Config-like for paver tool."""
from paver.easy import task, sh, path # noqa
# pylint: disable=invalid-name
cli_command_name = 'termius'
@task
def lint():
"""Check code style and conventions."""
sh('prospector')
@task
def bats():
"""Run tests on CLI usage."""
sh('bats --tap tests/integration')
@task
def nosetests():
"""Run unit tests."""
sh('nosetests')
@task
def completion_tests():
"""Run integration tests for bash completion."""
sh('nosetests tests/integration/completion/bash/')
@task
def coverage():
"""Run test and collect coverage."""
sh('nosetests --with-coverage')
sh('coverage xml')
@task
def create_compeletion(info):
"""Generate bash completion."""
completion_dir = path('contrib/completion/bash')
if not completion_dir.exists():
completion_dir.makedirs_p()
completion_path = completion_dir / cli_command_name
if completion_path.exists():
info('Completion exists')
else:
sh('{} complete > {}'.format(cli_command_name, completion_path))
@task
def clean_compeletion(info):
"""Generate bash completion."""
completion_path = path('contrib/bash/complete') / cli_command_name
completion_path.remove()
info('Completion exists')