-
Notifications
You must be signed in to change notification settings - Fork 7
/
pavement.py
76 lines (60 loc) · 2.55 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from paver.easy import task, needs, path, sh
@task
def clean():
for fl in ['BuildNotify.egg-info', 'build', 'dist', 'deb_dist']:
p = path(fl)
p.rmtree()
@task
def mk_resources():
"""Regenerate source corresponding to icons/Qt designer files"""
sh('pyuic5 -o buildnotifylib/generated/preferences_ui.py data/preferences.ui')
sh('pyuic5 -o buildnotifylib/generated/server_configuration_ui.py data/server_configuration.ui')
sh('pyrcc5 icons/icons.qrc -o buildnotifylib/generated/icons_rc.py')
@task
@needs('dist_pypi', 'dist_ppa')
def dist():
"""Triggers dist_pypi and dist_ppa"""
pass
@task
@needs('clean')
def dist_pypi():
sh('python3 setup.py sdist')
@task
@needs('dist_pypi')
def release_pypi():
"""Upload package to https://pypi.python.org/pypi/BuildNotify/"""
# Set TWINE_USERNAME, TWINE_PASSWORD
pkg = path('dist').files('*.tar.gz')[0].name
# sh('twine upload --sign dist/' + pkg)
sh('twine upload dist/' + pkg)
@task
@needs('clean', 'mk_deb')
def dist_ppa():
"""Upload package to https://launchpad.net/~anay/+archive/ppa"""
sh('python3 setup.py --command-packages=stdeb.command sdist_dsc --force-buildsystem=False')
dist_package = path('deb_dist').dirs('buildnotify-*')[0]
sh('sed -i s/unstable/precise/ %s/debian/changelog' % dist_package)
sh('cd %s;dpkg-buildpackage -i -S -I -rfakeroot' % dist_package)
changes_file = path('deb_dist').files('*.changes')[0]
sh('dput ppa:anay/ppa %s' % changes_file)
@task
@needs('clean')
def mk_deb():
"""Build deb package"""
sh('python3 setup.py --command-packages=stdeb.command bdist_deb')
@task
@needs('clean')
def mk_osc():
"""Upload package to https://build.opensuse.org/package/repositories/home:Anay/BuildNotifyTest"""
sh('python3 setup.py sdist')
sh('python3 setup.py --command-packages=stdeb.command sdist_dsc --force-buildsystem=False')
dist_package = path('deb_dist').dirs('buildnotify-*')[0]
sh('rm %s' % path('../BuildNotifyTest').files('*.tar.gz')[0])
sh('rm %s' % path('../BuildNotifyTest').files('*.dsc')[0])
sh('cp %s/debian/changelog ../BuildNotifyTest/debian.changelog' % dist_package)
sh('cp %s/debian/control ../BuildNotifyTest/debian.control' % dist_package)
sh('cp %s/debian/rules ../BuildNotifyTest/debian.rules' % dist_package)
sh('cp %s ../BuildNotifyTest/' % path('dist').files('BuildNotify-*')[0])
sh('cp %s ../BuildNotifyTest/' % path('deb_dist').files('buildnotify*.dsc')[0])
sh('osc addremove ../BuildNotifyTest/')
sh('osc commit ../BuildNotifyTest/ -m"Updated package"')