Skip to content

Commit

Permalink
Fix documentation build: pin packaging==24.1, install with uv.
Browse files Browse the repository at this point in the history
Documentation builds on readthedocs have been failing due to
a conflict with the `packaging=24.2` package. We can avoid it by
pinning the package. We also ensure reproducible builds by using
uv to install packages from the lockfile.
  • Loading branch information
danieldjohnson committed Nov 21, 2024
1 parent e22d27f commit a2f44fa
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
24 changes: 10 additions & 14 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,18 @@ build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
post_checkout:
- bash docs/scripts/readthedocs_fetch_notebook_outputs.sh
commands:
# Fetch precomputed notebook outputs (if any)
- bash docs/scripts/readthedocs_fetch_notebook_outputs.sh
# Install and build using uv
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- uv sync --extra docs --frozen
- uv pip install readthedocs-sphinx-ext
- cd docs && uv run python -m sphinx -T -b html -d docs/_build/doctrees -D language=en . $READTHEDOCS_OUTPUT/html

sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: false

python:
install:
# Equivalent to 'pip install .'
- method: pip
path: .
# Equivalent to 'pip install .[docs]'
- method: pip
path: .
extra_requirements:
- docs
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ docs = [
"ipython",
"flax>=0.8.2",
"optax",
"setuptools",
"sphinx>=6.0.0,<7.3.0",
"sphinx-book-theme>=1.0.1",
"sphinxcontrib-katex",
"ipython>=8.8.0",
"myst-nb>=1.0.0",
"myst-parser>=3.0.1",
"matplotlib>=3.5.0",
"packaging==24.1",
"sphinx-collections>=0.0.1",
"sphinx_contributors",
"sphinx-hoverxref",
Expand Down
22 changes: 20 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a2f44fa

Please sign in to comment.