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

docs: Fix issue in readthedocs builds. #806

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

microbit-carlos
Copy link
Collaborator

@microbit-carlos microbit-carlos commented Jul 18, 2024

Somehow due to some dependency conflict resolution the Read The Docs build pipeline ended up installing v0.5 of the rtd sphinx theme instead of a newer version, which was somehow incompatible with the newer sphinx releases.

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/sphinx/builders/html/__init__.py", line 1120, in handle_page
    output = self.templates.render(templatename, ctx)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/readthedocs_ext/readthedocs.py", line 181, in rtd_render
    content = old_render(template, render_context)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/sphinx/jinja2glue.py", line 200, in render
    return self.environment.get_template(template).render(context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/jinja2/environment.py", line 939, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/sphinx/themes/basic/page.html", line 10, in top-level template code
    {%- extends "layout.html" %}
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/sphinx_rtd_theme/layout.html", line 23, in top-level template code
    <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
    ^^^^^^^^^^^^^^^^^^^^^^^^^
jinja2.exceptions.UndefinedError: 'style' is undefined

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/sphinx/cmd/build.py", line 337, in build_main
    app.build(args.force_all, args.filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/sphinx/application.py", line 378, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 297, in build_update
    self.build(to_build,
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 367, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 614, in write
    self._write_serial(sorted(docnames))
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/sphinx/builders/__init__.py", line 624, in _write_serial
    self.write_doc(docname, doctree)
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/sphinx/builders/html/__init__.py", line 666, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File "/home/docs/checkouts/readthedocs.org/user_builds/microbit-micropython/envs/latest/lib/python3.11/site-packages/sphinx/builders/html/__init__.py", line 1127, in handle_page
    raise ThemeError(__("An error happened in rendering the page %s.\nReason: %r") %
sphinx.errors.ThemeError: An error happened in rendering the page accelerometer.
Reason: UndefinedError("'style' is undefined")

Theme error:
An error happened in rendering the page accelerometer.
Reason: UndefinedError("'style' is undefined")

Somehow due to some dependency conflict resolution the Read The
Docs build pipeline ended up installing the rtd sphinx theme
with v0.5 instead of a newer version, which was somehow incompatible
with the newer sphinx releases.
@microbit-carlos
Copy link
Collaborator Author

Copy link
Collaborator Author

@microbit-carlos microbit-carlos left a comment

Choose a reason for hiding this comment

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

This fixes a current issue building the docs, so I'll merge it right away.

@microbit-carlos microbit-carlos merged commit 8c7cc72 into bbcmicrobit:master Jul 18, 2024
2 checks passed
@microbit-carlos microbit-carlos deleted the docs-rtd-fix branch July 18, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant