de-nova setup system

This commit is contained in:
Jason Kölker 2011-11-01 13:09:35 -05:00
parent 245230e420
commit 869dc95104
3 changed files with 79 additions and 90 deletions

View File

@ -15,7 +15,14 @@
# License for the specific language governing permissions and limitations
# under the License.
MELANGE_VERSION = ['2011', '1']
try:
from melange.vcsversion import version_info
except ImportError:
version_info = {'branch_nick': u'LOCALBRANCH',
'revision_id': 'LOCALREVISION',
'revno': 0}
MELANGE_VERSION = ['2012', '1']
YEAR, COUNT = MELANGE_VERSION
FINAL = False # This becomes true at Release Candidate time
@ -29,4 +36,12 @@ def version_string():
if FINAL:
return canonical_version_string()
else:
return '%s-dev' % canonical_version_string()
return '%s-dev' % (canonical_version_string(),)
def vcs_version_string():
return "%s:%s" % (version_info['branch_nick'], version_info['revision_id'])
def version_string_with_vcs():
return "%s-%s" % (canonical_version_string(), vcs_version_string())

111
setup.py
View File

@ -17,10 +17,8 @@
# under the License.
import gettext
import glob
import os
import subprocess
import sys
from setuptools import find_packages
from setuptools.command.sdist import sdist
@ -38,35 +36,49 @@ except ImportError:
print "To build nova with support for message catalogs, you need "
print " https://launchpad.net/python-distutils-extra >= 2.18"
gettext.install('nova', unicode=1)
gettext.install('melange', unicode=1)
from nova.utils import parse_mailmap, str_dict_replace
from nova import version
from openstack.common.utils import parse_mailmap, str_dict_replace
from melange import version
if os.path.isdir('.bzr'):
with open("nova/vcsversion.py", 'w') as version_file:
vcs_cmd = subprocess.Popen(["bzr", "version-info", "--python"],
def run_git_command(cmd):
output = subprocess.Popen(["/bin/sh", "-c", cmd],
stdout=subprocess.PIPE)
vcsversion = vcs_cmd.communicate()[0]
version_file.write(vcsversion)
return output.communicate()[0].strip()
if os.path.isdir('.git'):
branch_nick_cmd = 'git branch | grep -Ei "\* (.*)" | cut -f2 -d" "'
branch_nick = run_git_command(branch_nick_cmd)
revid_cmd = "git --no-pager log --max-count=1 | cut -f2 -d' ' | head -1"
revid = run_git_command(revid_cmd)
revno_cmd = "git --no-pager log --oneline | wc -l"
revno = run_git_command(revno_cmd)
with open("melange/vcsversion.py", 'w') as version_file:
version_file.write("""
# This file is automatically generated by setup.py, So don't edit it. :)
version_info = {
'branch_nick': '%s',
'revision_id': '%s',
'revno': %s
}
""" % (branch_nick, revid, revno))
class local_sdist(sdist):
"""Customized sdist hook - builds the ChangeLog file from VC first"""
def run(self):
if os.path.isdir('.bzr'):
# We're in a bzr branch
env = os.environ.copy()
env['BZR_PLUGIN_PATH'] = os.path.abspath('./bzrplugins')
log_cmd = subprocess.Popen(["bzr", "log", "--novalog"],
stdout=subprocess.PIPE, env=env)
changelog = log_cmd.communicate()[0]
if os.path.isdir('.git'):
git_log_gnu = 'git log --format="%ai %aN %n%n%x09* %s%d%n"'
changelog = run_git_command(git_log_gnu)
mailmap = parse_mailmap()
with open("ChangeLog", "w") as changelog_file:
changelog_file.write(str_dict_replace(changelog, mailmap))
sdist.run(self)
nova_cmdclass = {'sdist': local_sdist}
cmdclass = {'sdist': local_sdist}
try:
@ -78,7 +90,7 @@ try:
self.builder = builder
self.finalize_options()
BuildDoc.run(self)
nova_cmdclass['build_sphinx'] = local_BuildDoc
cmdclass['build_sphinx'] = local_BuildDoc
except:
pass
@ -86,51 +98,34 @@ except:
try:
from babel.messages import frontend as babel
nova_cmdclass['compile_catalog'] = babel.compile_catalog
nova_cmdclass['extract_messages'] = babel.extract_messages
nova_cmdclass['init_catalog'] = babel.init_catalog
nova_cmdclass['update_catalog'] = babel.update_catalog
cmdclass['compile_catalog'] = babel.compile_catalog
cmdclass['extract_messages'] = babel.extract_messages
cmdclass['init_catalog'] = babel.init_catalog
cmdclass['update_catalog'] = babel.update_catalog
except:
pass
def find_data_files(destdir, srcdir):
package_data = []
files = []
for d in glob.glob('%s/*' % (srcdir, )):
if os.path.isdir(d):
package_data += find_data_files(
os.path.join(destdir, os.path.basename(d)), d)
else:
files += [d]
package_data += [(destdir, files)]
return package_data
setup(name='nova',
setup(name='melange',
version=version.canonical_version_string(),
description='cloud computing fabric controller',
description='IPAM mangement service for Openstack',
author='OpenStack',
author_email='nova@lists.launchpad.net',
author_email='openstack@lists.launchpad.net',
url='http://www.openstack.org/',
cmdclass=nova_cmdclass,
packages=find_packages(exclude=['bin', 'smoketests']),
cmdclass=cmdclass,
packages=find_packages(exclude=['bin']),
include_package_data=True,
test_suite='nose.collector',
data_files=find_data_files('share/nova', 'tools'),
scripts=['bin/nova-ajax-console-proxy',
'bin/nova-api',
'bin/nova-compute',
'bin/nova-console',
'bin/nova-dhcpbridge',
'bin/nova-direct-api',
'bin/nova-logspool',
'bin/nova-manage',
'bin/nova-network',
'bin/nova-objectstore',
'bin/nova-scheduler',
'bin/nova-spoolsentry',
'bin/stack',
'bin/nova-volume',
'bin/nova-vncproxy',
'tools/nova-debug'],
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.6',
'Environment :: No Input/Output (Daemon)',
],
scripts=['bin/melange',
'bin/melange-api',
'bin/melange-manage',
'bin/melange-delete-deallocated-ips',
],
py_modules=[])

View File

@ -1,38 +1,17 @@
SQLAlchemy==0.6.3
pep8==0.6.1
pylint==0.19
Cheetah==2.4.4
M2Crypto==0.20.2
amqplib==0.6.1
anyjson==0.2.4
boto==1.9b
carrot==0.10.5
SQLAlchemy
pep8
pylint
eventlet
kombu==1.0.4
lockfile==0.8
lxml==2.3
python-novaclient==2.6.5
python-daemon==1.5.5
python-gflags==1.3
redis==2.0.0
routes==1.12.3
WebOb==1.0.8
wsgiref==0.1.2
mox==0.5.3
greenlet==0.3.1
routes
WebOb
mox
nose
PasteDeploy>=1.5
PasteDeploy
paste
sqlalchemy-migrate
netaddr
sphinx
glance
xattr>=0.6.0
nova-adminclient
suds==0.4
coverage
nosexcover
paramiko
feedparser
webtest
factory_boy