Skip to content

Commit

Permalink
Merge pull request #213 from zopefoundation/rtd_build_extra
Browse files Browse the repository at this point in the history
Add ability to specify additional RTD build options
  • Loading branch information
dataflake authored Oct 6, 2023
2 parents 44c9af3 + 81a9fbb commit aab35d7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
17 changes: 16 additions & 1 deletion config/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,12 @@ updated. Example:
"*.mo",
]
[readthedocs]
build-extra = [
"apt_packages:",
" - libldap2-dev",
]
Meta Options
````````````
Expand Down Expand Up @@ -688,7 +694,6 @@ options
(Additional) options used to configure ``zest.releaser``. This option has to
be a list of strings and defaults to an empty list.


git options
```````````

Expand All @@ -698,6 +703,16 @@ ignore
Additional lines to be added to the ``.gitignore`` file. This option has to
be a list of strings and defaults to an empty list.

ReadTheDocs options
```````````````````

The corresponding section is named: ``[readthedocs]``.

build-extra
Additional lines to be added to the ``build`` configuration in the
ReadTheDocs configuration file ``.readthedocs.yaml``. This option has to
be a list of strings and defaults to an empty list.

Hints
-----

Expand Down
8 changes: 6 additions & 2 deletions config/config-package.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,13 @@ def gitignore(self):
)

def readthedocs(self):
build_extra = self.cfg_option(
'readthedocs', 'build-extra', default=[])
self.copy_with_meta(
'readthedocs.yaml.j2', self.path / '.readthedocs.yaml',
self.config_type
'readthedocs.yaml.j2',
self.path / '.readthedocs.yaml',
self.config_type,
build_extra=build_extra,
)

def coveragerc(self):
Expand Down
5 changes: 5 additions & 0 deletions config/default/readthedocs.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ build:
os: ubuntu-22.04
tools:
python: "3.11"
{% if build_extra %}
{% for line in build_extra %}
%(line)s
{% endfor %}
{% endif %}

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down

0 comments on commit aab35d7

Please sign in to comment.