Skip to content

Commit 2596a20

Browse files
authored
Merge pull request #871 from cderici/revisit-autodocs-sphinx
#871 #### Description This is the first step to revive the auto doc generation (that hasn't been touched for more than 4 years now), so we can get that rolling whenever we land a PR or make a release the docs will be generated and [published on ReadTheDocs](https://pythonlibjuju.readthedocs.io/en/latest/). The infrastructure is working (i.e. RTD seems to be picking it up), we just need to fix the sphinx build there that's been failing for a long time https://readthedocs.org/projects/python-libjuju/builds/18115299/ I'm not entirely sure yet how to debug the build process on the RTD, however, this change updates and fixes the sphinx setup in the `docs`, so we can run `make html` and actually be able to render the docs. The rest is to be figured out. #### QA Steps ```sh $ cd docs $ make html $ <browser> _build/html/index.html ``` #### Notes & Discussion - I'm not entirely sure but there might be some local package requirements, which I had to install but I can't remember, I think one of them was `python3-sphinxcontrib-asyncio`. - One of the huge advantages of this is that it also generates a reference for the internal API coming from the facade schema, which allows us (the developers) to see the parameters without going into the depths of the `juju/client/`. For example, check out the `_definitions` module [here](https://pythonlibjuju.readthedocs.io/en/latest/api/juju.client.html#module-juju.client._definitions)
2 parents 636cd10 + 02cab38 commit 2596a20

6 files changed

Lines changed: 25 additions & 26 deletions

File tree

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ BUILDDIR = _build
99

1010
# User-friendly check for sphinx-build
1111
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12-
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from http://sphinx-doc.org/)
12+
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from http://sphinx-doc.org/)
1313
endif
1414

1515
# Internal variables.

docs/_extensions/automembersummary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
import textwrap
1919

2020
from docutils import nodes
21+
from docutils.parsers.rst import Directive
2122
from docutils.statemachine import ViewList
2223
from sphinx.errors import SphinxError
23-
from sphinx.util.compat import Directive
2424
from sphinx.util.nodes import nested_parse_with_titles
2525

2626

docs/api/juju.cloud.rst

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/changelog.rst

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ endpoints for secrets backend.
1111

1212
This release works with any Juju 3.x controller.
1313

14-
## What's Changed
14+
What's Changed
15+
==============
16+
1517
* [JUJU-3202] Add facades for 3.1.1. by @juanmanuel-tirado in https://github.com/juju/python-libjuju/pull/807
1618
* Add destroy units by @cderici in https://github.com/juju/python-libjuju/pull/812
1719
* [JUJU-3517] Revisit _build_facades in connection by @cderici in https://github.com/juju/python-libjuju/pull/826
@@ -29,7 +31,9 @@ Connectivity with juju controllers in the 3.x series is allowed, connections wit
2931

3032
This version is only tested using Juju 3.1.0.
3133

32-
## What's Changed
34+
What's Changed
35+
==============
36+
3337
* setup.py: adjust websockets versions for py38-310 by @mert-kirpici in https://github.com/juju/python-libjuju/pull/731
3438
* [JUJU-2175] Remove juju 2.9 support on 3.1.0 by @juanmanuel-tirado in https://github.com/juju/python-libjuju/pull/774
3539
* [JUJU-2276] Series or base for local charms by @cderici in https://github.com/juju/python-libjuju/pull/777
@@ -42,7 +46,9 @@ This version is only tested using Juju 3.1.0.
4246
* Add compatibility for juju 3.1.0 by @juanmanuel-tirado in https://github.com/juju/python-libjuju/pull/799
4347
* Replace schemas.json with a wellformed version. by @juanmanuel-tirado in https://github.com/juju/python-libjuju/pull/800
4448

45-
## New Contributors
49+
New Contributors
50+
================
51+
4652
* @mert-kirpici made their first contribution in https://github.com/juju/python-libjuju/pull/731
4753

4854
**Full Changelog**: https://github.com/juju/python-libjuju/compare/3.0.4...3.1.0.1
@@ -52,12 +58,16 @@ This version is only tested using Juju 3.1.0.
5258

5359
Wednesday 26th October
5460

55-
## What's Changed
61+
What's Changed
62+
==============
63+
5664
* [JUJU-2027] Local refresh with resoruces by @cderici in https://github.com/juju/python-libjuju/pull/757
5765
* [JUJU-2026] Improve resolve charm by @cderici in https://github.com/juju/python-libjuju/pull/761
5866
* Add owner and data to license file by @arturo-seijas in https://github.com/juju/python-libjuju/pull/760
5967

60-
## New Contributors
68+
New Contributors
69+
================
70+
6171
* @arturo-seijas made their first contribution in https://github.com/juju/python-libjuju/pull/760
6272

6373
**Full Changelog**: https://github.com/juju/python-libjuju/compare/3.0.3...3.0.4
@@ -67,7 +77,8 @@ Wednesday 26th October
6777

6878
Saturay October 22 2022
6979

70-
## What's Changed
80+
What's Changed
81+
==============
7182

7283
* Wait for idle arg type check by @cderici in https://github.com/juju/python-libjuju/pull/741
7384
* [JUJU-1970] Revise local refresh by @cderici in https://github.com/juju/python-libjuju/pull/742
@@ -87,7 +98,8 @@ Saturay October 22 2022
8798

8899
Wednesday October 5 2022
89100

90-
## What's Changed
101+
What's Changed
102+
==============
91103

92104
* Model name can now be accessed through model.name by @jack-w-shaw in https://github.com/juju/python-libjuju/pull/702
93105
* [JUJU-1593] Fix `unit.run()` and update the old client codes by @cderici in https://github.com/juju/python-libjuju/pull/710

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
#
7878
# This is also used if you do content translation via gettext catalogs.
7979
# Usually you set "language" from the command line for these cases.
80-
language = None
80+
language = "en"
8181

8282
# There are two options for replacing |today|: either, you set today to some
8383
# non-false value, then it is used:
@@ -300,4 +300,4 @@
300300
#texinfo_no_detailmenu = False
301301

302302
def setup(app):
303-
app.add_stylesheet('custom.css')
303+
app.add_css_file('custom.css')

docs/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
pytz<2018.0,>=2017.2 # conflict between sphinx and macaroonbakery
1+
pytz==2021.1
22
pymacaroons>=0.13.0,<1.0 # force new version with pynacl instead of libnacl
3-
sphinx==1.6.5
3+
sphinx==4.3.2
44
sphinxcontrib-asyncio
55
sphinx_rtd_theme

0 commit comments

Comments
 (0)