From bef0ac86d830993c5599fd8d55d86685187ee8c1 Mon Sep 17 00:00:00 2001 From: Jake Hunsaker Date: Fri, 24 Jul 2020 11:43:01 -0400 Subject: [docs] Update sphinx doc generation Updates the sphinx configuration for 4.0 and extends the generated docs to cover parsers and clusters. Updates the location of plugins to the new structure. Updates setup.py to include sphinx build configuration, as we are no longer using make. Closes: #1991 Resolves: #2172 Signed-off-by: Jake Hunsaker --- setup.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 85d426ba..7138d324 100644 --- a/setup.py +++ b/setup.py @@ -58,6 +58,22 @@ class InstallData(install_data): return (out+".gz", _) return (out, _) +cmdclass = {'build': BuildData, 'install_data': InstallData} +command_options = {} +try: + from sphinx.setup_command import BuildDoc + cmdclass['build_sphinx'] = BuildDoc + command_options={ + 'build_sphinx': { + 'project': ('setup.py', 'sos'), + 'version': ('setup.py', VERSION), + 'source_dir': ('setup.py', 'docs') + } + } +except Exception: + print("Unable to build sphinx docs - module not present. Install sphinx " + "to enable documentation generation") + setup( name='sos', version=VERSION, @@ -84,9 +100,10 @@ setup( 'sos.collector', 'sos.collector.clusters', 'sos.cleaner', 'sos.cleaner.mappings', 'sos.cleaner.parsers' ], - cmdclass={'build': BuildData, 'install_data': InstallData}, + cmdclass=cmdclass, + command_options=command_options, requires=['pexpect'] - ) + ) # vim: set et ts=4 sw=4 : -- cgit