Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (28 sloc) 1.04 KB
import os
import re
version_re = re.compile(r'''version\s*=\s*['"](?P<version>[\d\.]+)['"]''')
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('python2.5 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); python2.5 setup.py egg_info')
# Release the code.
local('python2.5 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('python2.5 bootstrap.py')
local('./bin/buildout -v')
local('./bin/test')