Skip to content

[ci] [R-package] fix docs build, test pkgdown build in CI - #7268

Merged
jameslamb merged 12 commits into
masterfrom
fix/docs-build
May 16, 2026
Merged

jameslamb merged 12 commits into
masterfrom
fix/docs-build

Conversation

@jameslamb

@jameslamb jameslamb commented May 12, 2026 •

Copy link
Copy Markdown
Member

Fixes #7267

Something at the intersection of {roxygen2} 8.0.0 (new a few days ago) and changes in #7148 have led to {pkgdown} site build failing like this:

Error:
--
  | ! in callr subprocess.
  | Caused by error in `build_reference_index(pkg)`:
  | ! In pkgdown/_pkgdown.yml, 1 topic missing from index: "lgb.interprete".
  | β„Ή Either add to the reference index, or use `@keywords internal` to drop from
  | the index.

This fixes that and ensures that build is done in PR CI, so we can catch such issues earlier.

Other small related changes:

  • introducing .ci/build-docs.R to avoid duplicating the pkgdown::build_site() call in multiple places
  • bumping a few dependencies in the docs env
  • using {roxygen2} 8.0.0

Notes for Reviewers

How I tested this

Enabled this branch on readthedocs and visually inspected the docs.

@@ -1,4 +1,5 @@
template:
bootstrap: 5

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes this long-standing warning in {pkgdown} builds.

βœ– Bootstrap 3 is deprecated; please switch to Bootstrap 5.
β„Ή Learn more at
  <https://www.tidyverse.org/blog/2021/12/pkgdown-2-0-0/#bootstrap-5>.

Comment thread R-package/DESCRIPTION
SystemRequirements:
C++17
RoxygenNote: 7.3.3
Config/roxygen2/version: 8.0.0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was auto-generated by roxygen2::roxygenize().

It's valid... there are many of these on CRAN: https://github.com/search?q=org%3Acran%20%22Config%2Froxygen2%2Fversion%22&type=code

Comment thread .readthedocs.yaml
os: "ubuntu-24.04"
tools:
python: "mambaforge-23.11"
python: "miniforge3-latest"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mambaforge-* has been deprecated on readthedocs since July 2024: readthedocs/readthedocs.org#11690 (comment)

As a result of the libmamba solver becoming the default in conda.

Proposing:

  • switching to miniforge
  • using the *-latest one so we don't need to update as readthedocs supports new versions

- title: Deprecated
desc: Functionality that will be removed in the future
contents:
- '`lgb.interprete`'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the broken builds.

Comment thread .ci/pip-envs/requirements-latest.txt Outdated
scikit-learn>=1.9.dev0

# TODO: use 'scikit-learn' nightlies again when https://github.com/scikit-learn/scikit-learn/issues/33993 is resolved
scikit-learn==1.8.*

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For #7269

All CI-blocking issues need to be resolved together in the same PR if we want to merge this normally without admin overrides.

@jameslamb jameslamb changed the title WIP: [ci] [R-package] fix docs build, test pkgdown build in CI WIP: [ci] [R-package] fix docs build, test pkgdown build in CI, temporarily skip scikit-learn nightlies May 12, 2026
@jameslamb jameslamb added the blocking CI will be unsuccessful until this is resolved. label May 12, 2026
+ " The Dask client used by this class will not be saved if the model object is pickled.\n"
+ "**kwargs\n"
+ _after_kwargs
)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builds were failing with new errors from docutils:

dask.py:docstring of lightgbm.dask.DaskLGBMClassifier.__init__:77: WARNING: Inline strong start-string without end-string. [docutils]
dask.py:docstring of lightgbm.dask.DaskLGBMClassifier.__init__:78: WARNING: Definition list ends without a blank line; unexpected unindent. [docutils]
dask.py:docstring of lightgbm.dask.DaskLGBMRanker.__init__:77: WARNING: Inline strong start-string without end-string. [docutils]
dask.py:docstring of lightgbm.dask.DaskLGBMRanker.__init__:78: WARNING: Definition list ends without a blank line; unexpected unindent. [docutils]
dask.py:docstring of lightgbm.dask.DaskLGBMRegressor.__init__:77: WARNING: Inline strong start-string without end-string. [docutils]
dask.py:docstring of lightgbm.dask.DaskLGBMRegressor.__init__:78: WARNING: Definition list ends without a blank line; unexpected unindent. [docutils]

example: https://app.readthedocs.org/projects/lightgbm/builds/32648001/

Looks like this is catching a legitimate issue that's been in the project for a while!

import lightgbm as lgb
print(lgb.DaskLGBMRanker.__init__.__doc__)

Look at this incorrect indentation:

Image

As far as I can tell this doesn't affect docs like https://lightgbm.readthedocs.io/en/fix-docs-build/pythonapi/lightgbm.DaskLGBMClassifier.html in a noticeable way, but still worth fixing.

@jameslamb jameslamb changed the title WIP: [ci] [R-package] fix docs build, test pkgdown build in CI, temporarily skip scikit-learn nightlies [ci] [R-package] fix docs build, test pkgdown build in CI, temporarily skip scikit-learn nightlies May 12, 2026
@jameslamb
jameslamb marked this pull request as ready for review May 12, 2026 05:12
Comment thread .ci/pip-envs/requirements-latest.txt Resolved
@jameslamb

Copy link
Copy Markdown
Member Author

@mayer79 could you help with a review on this one? I'd like to get the docs builds in this repo working again (and this will ensure we catch errors like this in CI in the future).

@jameslamb jameslamb changed the title [ci] [R-package] fix docs build, test pkgdown build in CI, temporarily skip scikit-learn nightlies [ci] [R-package] fix docs build, test pkgdown build in CI May 15, 2026
@jameslamb

Copy link
Copy Markdown
Member Author

@borchero if you have a minute could you look at this one?

It'll fix the docs builds on readthedocs, which would also help with testing the docs changes in #7245

@borchero borchero left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@jameslamb jameslamb removed awaiting review blocking CI will be unsuccessful until this is resolved. labels May 16, 2026
@jameslamb
jameslamb enabled auto-merge (squash) May 16, 2026 16:25
@jameslamb
jameslamb merged commit eda8bdc into master May 16, 2026
59 checks passed
@jameslamb
jameslamb deleted the fix/docs-build branch May 16, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ci] [docs] docs builds broken: "In pkgdown/_pkgdown.yml, 1 topic missing from index: "lgb.interprete"

2 participants