~vishvananda/nova/lp720393

114 by Devin Carlen
Updated licenses
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3
# Copyright 2010 United States Government as represented by the
3.1.9 by Vishvananda Ishaya
Removed trailing whitespace from header
4
# Administrator of the National Aeronautics and Space Administration.
114 by Devin Carlen
Updated licenses
5
# All Rights Reserved.
6
#
7
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
8
#    not use this file except in compliance with the License. You may obtain
9
#    a copy of the License at
10
#
11
#         http://www.apache.org/licenses/LICENSE-2.0
12
#
1 by Jesse Andrews
initial commit
13
#    Unless required by applicable law or agreed to in writing, software
114 by Devin Carlen
Updated licenses
14
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16
#    License for the specific language governing permissions and limitations
17
#    under the License.
1 by Jesse Andrews
initial commit
18
396.2.1 by Soren Hansen
Added a .mailmap that maps addresses in bzr to people's real, preferred
19
import os
20
import subprocess
21
1 by Jesse Andrews
initial commit
22
from setuptools import setup, find_packages
186.1.1 by Monty Taylor
Added ChangeLog generation.
23
from setuptools.command.sdist import sdist
24
396.2.7 by Soren Hansen
Fix typo "nova.util" -> "nova.utils"
25
from nova.utils import parse_mailmap, str_dict_replace
515.6.2 by Soren Hansen
Less code generation.
26
from nova import version
27
28
if os.path.isdir('.bzr'):
29
    with open("nova/vcsversion.py", 'w') as version_file:
515.5.1 by Todd Willey
Track version info, and make available for logging.
30
        vcs_cmd = subprocess.Popen(["bzr", "version-info", "--python"],
31
                                   stdout=subprocess.PIPE)
32
        vcsversion = vcs_cmd.communicate()[0]
33
        version_file.write(vcsversion)
34
35
186.1.1 by Monty Taylor
Added ChangeLog generation.
36
class local_sdist(sdist):
37
    """Customized sdist hook - builds the ChangeLog file from VC first"""
38
39
    def run(self):
40
        if os.path.isdir('.bzr'):
41
            # We're in a bzr branch
254.1.1 by Soren Hansen
Better log formatter for Nova. It's just like gnuchangelog, but logs the author rather than the committer.
42
            env = os.environ.copy()
43
            env['BZR_PLUGIN_PATH'] = os.path.abspath('./bzrplugins')
44
            log_cmd = subprocess.Popen(["bzr", "log", "--novalog"],
45
                                       stdout=subprocess.PIPE, env=env)
186.1.1 by Monty Taylor
Added ChangeLog generation.
46
            changelog = log_cmd.communicate()[0]
396.2.1 by Soren Hansen
Added a .mailmap that maps addresses in bzr to people's real, preferred
47
            mailmap = parse_mailmap()
186.1.1 by Monty Taylor
Added ChangeLog generation.
48
            with open("ChangeLog", "w") as changelog_file:
396.2.1 by Soren Hansen
Added a .mailmap that maps addresses in bzr to people's real, preferred
49
                changelog_file.write(str_dict_replace(changelog, mailmap))
186.1.1 by Monty Taylor
Added ChangeLog generation.
50
        sdist.run(self)
611.2.1 by Monty Taylor
Adds conditional around sphinx inclusion.
51
nova_cmdclass = {'sdist': local_sdist}
52
53
54
try:
55
    from sphinx.setup_command import BuildDoc
611.2.2 by Monty Taylor
Fixed a pep8 spacing issue.
56
611.2.1 by Monty Taylor
Adds conditional around sphinx inclusion.
57
    class local_BuildDoc(BuildDoc):
58
        def run(self):
59
            for builder in ['html', 'man']:
60
                self.builder = builder
61
                self.finalize_options()
62
                BuildDoc.run(self)
63
    nova_cmdclass['build_sphinx'] = local_BuildDoc
64
65
except:
66
    pass
67
536.1.1 by Monty Taylor
Added babel/gettext build support.
68
69
try:
579.2.1 by Soren Hansen
Refactor run_tests.sh to allow us to run an extra command after the tests.
70
    from babel.messages import frontend as babel
71
    nova_cmdclass['compile_catalog'] = babel.compile_catalog
72
    nova_cmdclass['extract_messages'] = babel.extract_messages
73
    nova_cmdclass['init_catalog'] = babel.init_catalog
74
    nova_cmdclass['update_catalog'] = babel.update_catalog
536.1.1 by Monty Taylor
Added babel/gettext build support.
75
except:
579.2.1 by Soren Hansen
Refactor run_tests.sh to allow us to run an extra command after the tests.
76
    pass
536.1.1 by Monty Taylor
Added babel/gettext build support.
77
1 by Jesse Andrews
initial commit
78
setup(name='nova',
515.6.5 by Soren Hansen
s/canonical_version/canonical_version_string/g
79
      version=version.canonical_version_string(),
175.2.1 by Soren Hansen
Bump version to 0.9.0.
80
      description='cloud computing fabric controller',
81
      author='OpenStack',
82
      author_email='nova@lists.launchpad.net',
83
      url='http://www.openstack.org/',
536.1.1 by Monty Taylor
Added babel/gettext build support.
84
      cmdclass=nova_cmdclass,
186.1.2 by Monty Taylor
Fixed pep8 issues in setup.py - thanks redbo.
85
      packages=find_packages(exclude=['bin', 'smoketests']),
423.1.1 by Soren Hansen
Add include_package_data=True to setup.py.
86
      include_package_data=True,
465.3.1 by Monty Taylor
Added reference in setup.py so that python setup.py test works now.
87
      test_suite='nose.collector',
181.1.5 by Monty Taylor
Updated setup.py file to install stuff on a python setup.py install command.
88
      scripts=['bin/nova-api',
89
               'bin/nova-compute',
90
               'bin/nova-dhcpbridge',
91
               'bin/nova-import-canonical-imagestore',
92
               'bin/nova-instancemonitor',
515.4.1 by Todd Willey
Apply logging changes as a giant patch to work around the cloudpipe delete + add issue in the original patch.
93
               'bin/nova-logspool',
181.1.5 by Monty Taylor
Updated setup.py file to install stuff on a python setup.py install command.
94
               'bin/nova-manage',
95
               'bin/nova-network',
96
               'bin/nova-objectstore',
292.1.2 by Soren Hansen
Install nova-scheduler.
97
               'bin/nova-scheduler',
515.4.1 by Todd Willey
Apply logging changes as a giant patch to work around the cloudpipe delete + add issue in the original patch.
98
               'bin/nova-spoolsentry',
382.3.2 by Vishvananda Ishaya
add nova-debug to setup.py
99
               'bin/nova-volume',
100
               'tools/nova-debug'])