diff options
author | Casey Deccio <casey@deccio.net> | 2015-09-09 00:01:30 +0300 |
---|---|---|
committer | Casey Deccio <casey@deccio.net> | 2015-09-09 00:01:30 +0300 |
commit | 379f0e05296735fd55323794e22a2969e91a632d (patch) | |
tree | 623d365bb0db03b22b15c13ab61e282d56135b70 /setup.py | |
parent | 6ca6872db1ded01432d781fbdde73097783aed55 (diff) |
Build documentation, if possible
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -8,6 +8,7 @@ import sys from distutils.core import setup from distutils.dist import Distribution from distutils.command.install import install +from distutils.command.build import build _install = install(Distribution()) _install.finalize_options() @@ -27,7 +28,19 @@ def apply_install_prefix(filename): in_fh.close() out_fh.close() -apply_install_prefix(os.path.join('dnsviz','config.py.in')) +def make_documentation(): + os.chdir('doc') + try: + if os.system('make') != 0: + sys.stderr.write('Warning: Some of the included documentation failed to build. Proceeding without it.\n') + finally: + os.chdir('..') + +class MyBuild(build): + def run(self): + apply_install_prefix(os.path.join('dnsviz','config.py.in')) + make_documentation() + build.run(self) setup(name='dnsviz', version='0.4.0', @@ -57,4 +70,5 @@ setup(name='dnsviz', 'm2crypto (>=0.21.1)', 'dnspython (>=1.11)', ], + cmdclass={ 'build': MyBuild }, ) |