Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to specify additional RTD build options #213

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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