-
Notifications
You must be signed in to change notification settings - Fork 2
/
tasks.py
42 lines (30 loc) · 873 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
from invoke import task
"""
LDServer tasks
To run:
* invoke build
* invoke test
* invoke version --part <major|minor|patch|beta|dev>
"""
VALID_PARTS = "major minor patch beta dev".split()
@task
def build(ctx):
"""
Recompile the C++ component (pywrapper)
"""
ctx.run("cget install --update core")
@task(build)
def test(ctx):
"""
Run all test cases using tox. This task will automatically execute build.
"""
ctx.run("tox")
@task(test)
def version(ctx, part):
"""
Bump the version number using semantic versioning scheme. The configuration is stored in setup.cfg.
The version will only be bumped if the build and test tasks run successfully.
"""
if part not in VALID_PARTS:
raise ValueError("Invalid part specifier: {}, must be one of {}".format(part, ", ".join(VALID_PARTS)))
ctx.run("bumpversion --verbose {}".format(part))