-
Notifications
You must be signed in to change notification settings - Fork 2
/
fabfile
36 lines (30 loc) · 1.11 KB
/
fabfile
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
import os
import re
version_re = re.compile(r'''version\s*=\s*['"](?P<version>[\d\.]+)['"]''')
python = '/home/jeroen/bin/python-with-extras'
set(python=python)
def get_version():
"""Extract the current version from the setup.py file."""
setup = open('setup.py').read()
return version_re.search(setup).group('version')
def release_djangorecipe():
"""Release Djangorecipe to PyPi."""
version = get_version()
test()
local('$(python) setup.py sdist')
# Make sure we have a proper release that could be installed.
local('tar xfz %s/dist/djangorecipe-%s.tar.gz -C /tmp' % (
os.path.abspath('.'), version))
local('cd /tmp/djangorecipe-$(version); $(python) setup.py egg_info')
# Release the code.
local('$(python) setup.py sdist register upload')
def release():
"""Release everything related to the project."""
set(version=get_version())
release_djangorecipe()
local('bzr tag release-$(version)')
def test():
"""Create an in-place installation and run the tests."""
local('$(python) bootstrap.py')
local('./bin/buildout -v')
local('./bin/test')