Merge pull request #388 from ThomasWaldmann/no-docs-build-by-default

do not try to build api / usage docs for production install
This commit is contained in:
TW 2015-11-08 16:56:39 +01:00
commit 3f6530d100
1 changed files with 7 additions and 7 deletions

View File

@ -202,11 +202,6 @@ API Documentation
:undoc-members: :undoc-members:
""" % mod) """ % mod)
# (function, predicate), see http://docs.python.org/2/distutils/apiref.html#distutils.cmd.Command.sub_commands
# seems like this doesn't work on RTD, see below for build_py hack.
build.sub_commands.append(('build_api', None))
build.sub_commands.append(('build_usage', None))
class build_py_custom(build_py): class build_py_custom(build_py):
"""override build_py to also build our stuff """override build_py to also build our stuff
@ -227,8 +222,13 @@ class build_py_custom(build_py):
super().run() super().run()
self.announce('calling custom build steps', level=log.INFO) self.announce('calling custom build steps', level=log.INFO)
self.run_command('build_ext') self.run_command('build_ext')
self.run_command('build_api') if on_rtd:
self.run_command('build_usage') # only build these files if running on readthedocs, but not
# for a normal production install. It requires "mock" and we
# do not have that as a build dependency. Also, for really
# building the docs, it would also require sphinx, etc.
self.run_command('build_api')
self.run_command('build_usage')
cmdclass = { cmdclass = {