Merge ~jugmac00/launchpadlib:add-configuration-file-for-rtd into launchpadlib:main

Proposed by Jürgen Gmach
Status: Merged
Merged at revision: e436fed825f53a035f5b211cd960e20ed747d9d5
Proposed branch: ~jugmac00/launchpadlib:add-configuration-file-for-rtd
Merge into: launchpadlib:main
Diff against target: 66 lines (+21/-3)
3 files modified
.readthedocs.yaml (+17/-0)
src/launchpadlib/docs/conf.py (+1/-1)
tox.ini (+3/-2)
Reviewer Review Type Date Requested Status
Ines Almeida Approve
Review via email: mp+445664@code.launchpad.net

Commit message

Add configuration file for Read the Docs

To post a comment you must log in.
Revision history for this message
Ines Almeida (ines-almeida) wrote :

Looks good to me, although I'm not into the details of readthedocs.yaml

Does the python section of the config basically tell it to build the docs from that path, to a `docs` directory, using pip?

I notice the other `.readthedocs.yaml` in our repos don't use `fail_on_warning`. I think it makes sense to add it, but maybe we also want to add it in the other ones to keep them consistent!

review: Approve
Revision history for this message
Jürgen Gmach (jugmac00) wrote :

> Does the python section of the config basically tell it to build the docs from that path, to a `docs` directory, using pip?

No.

This refers to the `extras_require` section in the `setup.py`.
https://git.launchpad.net/launchpadlib/tree/setup.py#n93

So the mentioned specification would translate to

```
pip install .[docs]
```

That is install the package plus the extra requirements specified in the `docs` `extras_require` section.

Another example would be the wtforms library - when you want to have the email validator enabled, you need to install it via `pip install wtforms[email_validator]`
https://github.com/wtforms/wtforms/blob/0524993ee57a957c8444df2b090c00464ef9bb2a/setup.cfg#L37

> I notice the other `.readthedocs.yaml` in our repos don't use `fail_on_warning`. I think it makes sense to add it, but maybe we also want to add it in the other ones to keep them consistent!

Indeed, it makes sense to use it, as otherwise technical debt can pile or even worse things break unnoticed.

Currently, it is very tedious to apply changes to all our repositories, that is why I created an item for the next roadmap cycle to introduce tooling for that.
https://docs.google.com/spreadsheets/d/1rmlPtCWr-nlIDE26Et_okt4yC4RRQX5r6wLik-M9WpM/edit#gid=1800655972

Revision history for this message
Ines Almeida (ines-almeida) wrote :

And thank you for clarifying!
And I am completely on board with the road map item suggestion :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.readthedocs.yaml b/.readthedocs.yaml
2new file mode 100644
3index 0000000..09c7853
4--- /dev/null
5+++ b/.readthedocs.yaml
6@@ -0,0 +1,17 @@
7+version: 2
8+
9+build:
10+ os: ubuntu-22.04
11+ tools:
12+ python: "3.8"
13+
14+python:
15+ install:
16+ - method: pip
17+ path: .
18+ extra_requirements:
19+ - docs
20+
21+sphinx:
22+ configuration: src/launchpadlib/docs/conf.py
23+ fail_on_warning: true
24diff --git a/src/launchpadlib/docs/conf.py b/src/launchpadlib/docs/conf.py
25index 05da684..268a8ce 100644
26--- a/src/launchpadlib/docs/conf.py
27+++ b/src/launchpadlib/docs/conf.py
28@@ -65,7 +65,7 @@ release = __version__
29 #
30 # This is also used if you do content translation via gettext catalogs.
31 # Usually you set "language" from the command line for these cases.
32-language = None
33+language = "en"
34
35 # List of patterns, relative to source directory, that match files and
36 # directories to ignore when looking for source files.
37diff --git a/tox.ini b/tox.ini
38index d71e61d..aaa62c9 100644
39--- a/tox.ini
40+++ b/tox.ini
41@@ -1,6 +1,7 @@
42 [tox]
43 envlist =
44 py27,py35,py36,py37,py38,py39,py310,py311,lint,docs
45+requires = virtualenv<20.22
46
47 [testenv]
48 deps =
49@@ -18,7 +19,7 @@ passenv =
50 http_proxy
51 https_proxy
52 basepython =
53- python3.8
54+ python3.8 # align with .launchpad.yaml
55 deps =
56 pre-commit
57 commands =
58@@ -26,7 +27,7 @@ commands =
59
60 [testenv:docs]
61 basepython =
62- python2.7
63+ python3.8 # align with .launchpad.yaml
64 commands =
65 sphinx-build -b html -d src/launchpadlib/docs/_build/doctrees src/launchpadlib/docs src/launchpadlib/docs/_build/html
66 deps =

Subscribers

People subscribed via source and target branches