You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2023/08/08 20:42:31 UTC
[libcloud] branch apidocs_improvements updated (5d658a4ea -> 263e22d9b)
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a change to branch apidocs_improvements
in repository https://gitbox.apache.org/repos/asf/libcloud.git
discard 5d658a4ea Move api docs building inside the sphinx config. This seems to be the preferred approach.
new 263e22d9b Move api docs building inside the sphinx config. This seems to be the preferred approach.
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (5d658a4ea)
\
N -- N -- N refs/heads/apidocs_improvements (263e22d9b)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
docs/conf.py | 4 ----
1 file changed, 4 deletions(-)
[libcloud] 01/01: Move api docs building inside the sphinx config. This seems to be the preferred approach.
Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch apidocs_improvements
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 263e22d9b2e8ad64f4f952b0db0404bc1bfbf133
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Aug 8 22:38:01 2023 +0200
Move api docs building inside the sphinx config. This seems to be the
preferred approach.
This way we can can re-use the same tox target for CI and simplify our
config.
Also update api docs config to use separate files for easier linking and
exclude test modules and packages from api docs.
---
.github/workflows/main.yml | 2 +-
docs/conf.py | 28 ++++++++++++++++++++++++----
tox.ini | 12 ------------
3 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 3e9c65927..ece3771e1 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -374,7 +374,7 @@ jobs:
- name: Build Docs
run: |
- tox -e docs-ci
+ tox -e docs
- name: Trigger ReadTheDocs build
if: ${{ github.ref_name == 'trunk' }}
diff --git a/docs/conf.py b/docs/conf.py
index f9e51d44e..ea176d877 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -14,9 +14,11 @@
import os
import re
import sys
+import glob
import datetime
import subprocess
+from sphinx.ext import apidoc
from sphinx.domains.python import PythonDomain
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -25,10 +27,6 @@ BASE_DIR = os.path.abspath(BASE_DIR)
# Detect if we are running on read the docs
on_rtd = os.environ.get("READTHEDOCS", "").lower() == "true"
-if on_rtd:
- cmd = "sphinx-apidoc -d 4 -o apidocs/ ../libcloud/"
- subprocess.call(cmd, shell=True)
-
# 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.
@@ -335,5 +333,27 @@ def linkify_issues_in_changelog(app, docname, source):
source[0] = source[0].replace(".. include:: ../CHANGES.rst", linkified_changelog)
+def run_apidoc(_):
+ # ignore test modules
+ ignore_paths = glob.glob("../libcloud/test/**/*.py", recursive=True)
+ # Problematic driver with hundreds of issues
+ ignore_paths += ["../libcloud/compute/drivers/outscale.py"]
+
+ argv = [
+ "--force", # Overwrite output files
+ "--follow-links", # Follow symbolic links
+ "--module-first", # Put module documentation before submodule
+ "--separate",
+ "--maxdepth",
+ "4",
+ "-o",
+ "apidocs", # Output path
+ "../libcloud", # include path
+ ] + ignore_paths
+
+ apidoc.main(argv)
+
+
def setup(app):
+ app.connect("builder-inited", run_apidoc)
app.connect("source-read", linkify_issues_in_changelog)
diff --git a/tox.ini b/tox.ini
index 6b98a8abd..b09da4472 100644
--- a/tox.ini
+++ b/tox.ini
@@ -180,21 +180,9 @@ deps =
-r{toxinidir}/requirements-docs.txt
changedir = docs
commands = rstcheck --report-level warning ../CHANGES.rst
- python ../contrib/generate_provider_feature_matrix_table.py
- sphinx-apidoc -d 4 ../libcloud/ -o apidocs/
- /bin/bash -c "ls apidocs/modules.rst && (grep orphan apidocs/modules.rst || sed -i '1i :orphan:\n' apidocs/modules.rst) || (exit 0)"
- # TODO: Add -W back when we fix all the warnings in docstrings
- sphinx-build -j auto -b html -d {envtmpdir}/doctrees . _build/html
-
-[testenv:docs-ci]
-deps =
- -r{toxinidir}/requirements-docs.txt
-changedir = docs
-commands = rstcheck --report-level warning ../README.rst
rstcheck --report-level warning ../CHANGES.rst
rstcheck --report-level warning ../CONTRIBUTING.rst
python ../contrib/generate_provider_feature_matrix_table.py
- /bin/bash -c "ls apidocs/modules.rst && (grep orphan apidocs/modules.rst || sed -i '1i :orphan:\n' apidocs/modules.rst) || (exit 0)"
# TODO: Add -W back when we fix all the warnings in docstrings
sphinx-build -j auto -b html -d {envtmpdir}/doctrees . _build/html