-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.py
57 lines (43 loc) · 1.88 KB
/
build.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
from pybuilder.core import use_plugin, init, Author, task
import subprocess
use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("python.coverage")
use_plugin("python.distutils")
use_plugin('copy_resources')
use_plugin('filter_resources')
name = "sunstone-rest-client"
result = subprocess.Popen(["git", "log", "--oneline"], stdout=subprocess.PIPE).communicate()[0]
commit_count = len(result.splitlines())
version = "0.1.%i" % commit_count
default_task = ["clean", "analyze", "publish"]
authors = [Author('Arne Hilmann', 'arne.hilmann@gmail.com')]
summary = 'sunstone rest client | an opennebula client in python, using the sunstone ReST API'
description = """sunstone rest client
an opennebula client in python, using the sunstone ReST API
instead of the XML-RPC
"""
url = 'https://github.com/arnehilmann/sunstone-rest-client'
license = 'Apache License v2.0'
@task
def gittag(project, logger):
logger.info("The following commands create a new release, triggering all the fun stuff:")
logger.info("git tag -a v{0} -m v{0}".format(project.version))
logger.info("git push --tags")
@init
def set_properties(project):
project.build_depends_on('mock')
project.build_depends_on('testfixtures')
project.depends_on("requests")
project.depends_on("bs4")
project.set_property('coverage_threshold_warn', 75)
project.set_property('coverage_break_build', True)
project.set_property('flake8_verbose_output', True)
project.set_property('flake8_include_test_sources', True)
project.set_property('flake8_ignore', 'E501,E402,E731')
project.set_property('flake8_break_build', True)
project.set_property('copy_resources_target', '$dir_dist')
project.get_property('copy_resources_glob').append('setup*.cfg')
project.get_property('filter_resources_glob').extend(['**/setup*.cfg'])