commit: cc73af5a6990dfa196c889421b8bcb77cf2d25e1
Author: Zac Medico gentoo org>
AuthorDate: Sun Feb 2 09:35:39 2020 +
Commit: Zac Medico gentoo org>
CommitDate: Mon Feb 3 09:26:35 2020 +
URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=cc73af5a
doc: replace epydoc with sphinx-apidoc + sphinx-epytext
Bug: https://bugs.gentoo.org/707820
Signed-off-by: Zac Medico gentoo.org>
doc/api/.gitignore | 1 +
doc/api/Makefile | 32 ++
doc/api/conf.py| 66 ++
doc/api/index.rst | 18 +++
setup.py | 33 ---
5 files changed, 131 insertions(+), 19 deletions(-)
diff --git a/doc/api/.gitignore b/doc/api/.gitignore
new file mode 100644
index 0..796b96d1c
--- /dev/null
+++ b/doc/api/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/doc/api/Makefile b/doc/api/Makefile
new file mode 100644
index 0..56420a497
--- /dev/null
+++ b/doc/api/Makefile
@@ -0,0 +1,32 @@
+# Makefile for Sphinx documentation
+#
+
+SPHINX_APIDOC_OPTIONS =
members,private-members,undoc-members,show-inheritance,ignore-module-all,inherited-members
+export SPHINX_APIDOC_OPTIONS
+
+# You can set these variables from the command line.
+SPHINXOPTS=
+SPHINXBUILD = sphinx-build
+SOURCEDIR = .
+BUILDDIR = build
+TOPDIR= ../..
+
+# Put it first so that "make" without argument is like "make help".
+help:
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+clean:
+ rm -rf $(BUILDDIR) $(SOURCEDIR)/api
+
+$(BUILDDIR)/_sources/portage.rst:
+ mkdir -p "$(BUILDDIR)/_sources"
+ cp -pPR "$(SOURCEDIR)/conf.py" "$(SOURCEDIR)/index.rst"
"$(BUILDDIR)/_sources"
+ sphinx-apidoc -TPef -o "$(BUILDDIR)/_sources" $(TOPDIR)/lib/_emerge
+ sphinx-apidoc -TPef -o "$(BUILDDIR)/_sources" $(TOPDIR)/lib/portage
$(TOPDIR)/lib/portage/tests
+
+.PHONY: help Makefile
+
+# Catch-all target: route all unknown targets to Sphinx using the new
+# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
+%: Makefile $(BUILDDIR)/_sources/portage.rst
+ @$(SPHINXBUILD) -M $@ "$(BUILDDIR)/_sources" "$(BUILDDIR)"
$(SPHINXOPTS) $(O)
diff --git a/doc/api/conf.py b/doc/api/conf.py
new file mode 100644
index 0..f318ca25d
--- /dev/null
+++ b/doc/api/conf.py
@@ -0,0 +1,66 @@
+# Configuration file for the Sphinx documentation builder.
+#
+# This file only contains a selection of the most common options. For a full
+# list see the documentation:
+# http://www.sphinx-doc.org/en/master/config
+
+# -- Path setup --
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#
+# import os
+# import sys
+# sys.path.insert(0, os.path.abspath('.'))
+
+import os
+from os import path as osp
+import sys
+
+if osp.isfile(osp.abspath(osp.join(osp.dirname(__file__),
"../../../../.portage_not_installed"))):
+ sys.path.insert(0, osp.abspath(osp.join(osp.dirname(__file__),
"../../../../lib")))
+import portage
+
+# -- Project information -
+
+project = 'portage'
+copyright = '2020, Gentoo Authors'
+author = 'Gentoo Authors'
+
+# The full version, including alpha/beta/rc tags
+release = str(portage.VERSION)
+
+# -- General configuration ---
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+ 'sphinx.ext.autodoc',
+ 'sphinx_epytext',
+]
+
+# Add any paths that contain templates here, relative to this directory.
+# templates_path = []
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This pattern also affects html_static_path and html_extra_path.
+# exclude_patterns = []
+
+# -- Options for HTML output -
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+#
+html_show_sourcelink = False
+html_theme = 'sphinxdoc'
+
+# 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 = []
+
+autodoc_default_options = dict((opt, True) for opt in
+ filter(None, os.environ.get('SPHINX_APIDOC_OPTIONS', '').split(',')))
diff --git a/doc/api/index.rst b/doc/api/index.rst
new file mode 100644
index 0..ffaece6c9
--- /dev/null
+++ b/doc/api/index.rst
@@ -0,0 +1,18 @@
+Portage API