From 5dcf2f45c5485837ea9625f668f6ad6b1d1e1924 Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Thu, 16 Apr 2020 11:32:50 -0700 Subject: [PATCH] updates to allow building python docs again, also added checks for requirements to build the python docs --- configure.ac | 21 ++++++++------------- daemon/core/api/grpc/server.py | 7 +++---- daemon/doc/Makefile.am | 2 +- daemon/doc/conf.py.in | 2 +- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/configure.ac b/configure.ac index 24f322f0..588f3f34 100644 --- a/configure.ac +++ b/configure.ac @@ -43,6 +43,11 @@ AC_ARG_ENABLE([gui], [build and install the GUI (default is yes)])], [], [enable_gui=yes]) AC_SUBST(enable_gui) +AC_ARG_ENABLE([docs], + [AS_HELP_STRING([--enable-docs[=ARG]], + [build python documentation (default is no)])], + [], [enable_docs=no]) +AC_SUBST(enable_docs) AC_ARG_ENABLE([python], [AS_HELP_STRING([--enable-python[=ARG]], @@ -191,8 +196,7 @@ if [ test "x$enable_daemon" = "xyes" || test "x$enable_vnodedonly" = "xyes" ] ; fi want_docs=no -if test "x$enable_docs" = "xyes" ; then - +if [test "x$want_python" = "xyes" && test "x$enable_docs" = "xyes"] ; then AC_CHECK_PROG(help2man, help2man, yes, no, $SEARCHPATH) if test "x$help2man" = "xno" ; then @@ -210,21 +214,12 @@ if test "x$enable_docs" = "xyes" ; then # check for sphinx required during make AC_CHECK_PROG(sphinxapi_path, sphinx-apidoc, $as_dir, no, $SEARCHPATH) if test "x$sphinxapi_path" = "xno" ; then - AC_MSG_ERROR(["Could not location sphinx-apidoc, from the python-sphinx package"]) + AC_MSG_ERROR(["Could not locate sphinx-apidoc, install python3 -m pip install sphinx"]) want_docs=no fi + AS_IF([$PYTHON -c "import sphinx_rtd_theme" &> /dev/null], [], [AC_MSG_ERROR([doc dependency missing, please install python3 -m pip install sphinx-rtd-theme])]) fi -#AC_PATH_PROGS(tcl_path, [tclsh tclsh8.5 tclsh8.4], no) -#if test "x$tcl_path" = "xno" ; then -# AC_MSG_ERROR([Could not locate tclsh. Please install Tcl/Tk.]) -#fi - -#AC_PATH_PROGS(wish_path, [wish wish8.5 wish8.4], no) -#if test "x$wish_path" = "xno" ; then -# AC_MSG_ERROR([Could not locate wish. Please install Tcl/Tk.]) -#fi - AC_ARG_WITH([startup], [AS_HELP_STRING([--with-startup=option], [option=systemd,suse,none to install systemd/SUSE init scripts])], diff --git a/daemon/core/api/grpc/server.py b/daemon/core/api/grpc/server.py index d9c23628..ca5eb0ad 100644 --- a/daemon/core/api/grpc/server.py +++ b/daemon/core/api/grpc/server.py @@ -1031,8 +1031,7 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer): """ Retrieve all the default services of all node types in a session - :param request: - get-default-service request + :param request: get-default-service request :param context: context object :return: get-service-defaults response about all the available default services """ @@ -1050,8 +1049,8 @@ class CoreGrpcServer(core_pb2_grpc.CoreApiServicer): ) -> SetServiceDefaultsResponse: """ Set new default services to the session after whipping out the old ones - :param request: set-service-defaults - request + + :param request: set-service-defaults request :param context: context object :return: set-service-defaults response """ diff --git a/daemon/doc/Makefile.am b/daemon/doc/Makefile.am index 6f287b09..e46f7d32 100644 --- a/daemon/doc/Makefile.am +++ b/daemon/doc/Makefile.am @@ -10,7 +10,7 @@ # extra cruft to remove DISTCLEANFILES = conf.py Makefile Makefile.in stamp-vti *.rst -all: index.rst +all: html # auto-generated Python documentation using Sphinx index.rst: diff --git a/daemon/doc/conf.py.in b/daemon/doc/conf.py.in index eee03477..99929cee 100644 --- a/daemon/doc/conf.py.in +++ b/daemon/doc/conf.py.in @@ -121,7 +121,7 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +#html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format.