diff options
| author | Monty Taylor <mordred@inaugust.com> | 2011-01-28 08:04:31 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-01-28 08:04:31 +0000 |
| commit | 381893d0ad7482d0cc15f6806fd0d509e7c95fcd (patch) | |
| tree | 1eef7c55c142bfb6e3032dde306844123bc4703b /setup.py | |
| parent | 2a64ccb8139eb30aab394391cf137d4cb83ce55e (diff) | |
| parent | dd7008e4edc6e9be2248ff663664adb2a662e745 (diff) | |
| download | nova-381893d0ad7482d0cc15f6806fd0d509e7c95fcd.tar.gz nova-381893d0ad7482d0cc15f6806fd0d509e7c95fcd.tar.xz nova-381893d0ad7482d0cc15f6806fd0d509e7c95fcd.zip | |
Makes having sphinx to build docs a conditional thing - if you have it, you can get docs. If you don't, you can't.
Diffstat (limited to 'setup.py')
| -rw-r--r-- | setup.py | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -21,7 +21,6 @@ import subprocess from setuptools import setup, find_packages from setuptools.command.sdist import sdist -from sphinx.setup_command import BuildDoc from nova.utils import parse_mailmap, str_dict_replace from nova import version @@ -34,14 +33,6 @@ if os.path.isdir('.bzr'): version_file.write(vcsversion) -class local_BuildDoc(BuildDoc): - def run(self): - for builder in ['html', 'man']: - self.builder = builder - self.finalize_options() - BuildDoc.run(self) - - class local_sdist(sdist): """Customized sdist hook - builds the ChangeLog file from VC first""" @@ -57,9 +48,23 @@ class local_sdist(sdist): with open("ChangeLog", "w") as changelog_file: changelog_file.write(str_dict_replace(changelog, mailmap)) sdist.run(self) +nova_cmdclass = {'sdist': local_sdist} + + +try: + from sphinx.setup_command import BuildDoc + + class local_BuildDoc(BuildDoc): + def run(self): + for builder in ['html', 'man']: + self.builder = builder + self.finalize_options() + BuildDoc.run(self) + nova_cmdclass['build_sphinx'] = local_BuildDoc + +except: + pass -nova_cmdclass = {'sdist': local_sdist, - 'build_sphinx': local_BuildDoc} try: from babel.messages import frontend as babel |
