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

#11690 Update pydoctor version #11668

Merged
merged 6 commits into from Oct 3, 2022
Merged

#11690 Update pydoctor version #11668

merged 6 commits into from Oct 3, 2022

Conversation

tristanlatr
Copy link
Contributor

@tristanlatr tristanlatr commented Sep 16, 2022

Scope and purpose

Fixes the zope interface informations. They show up as expected now.

I saw that the link to the latest version of the docs is always shown no matter the version of docs being reviewed, so I’ll try to fix that as well in this PR.

Fixes #11690.

@twm twm changed the title Update pydoctor version #11690 Update pydoctor version Sep 24, 2022
@twm
Copy link
Contributor

twm commented Sep 24, 2022

@tristanlatr It looks like this is failing in RTD:

Big traceback
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/sphinx/builders/html/__init__.py", line 1096, in handle_page
    output = self.templates.render(templatename, ctx)
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/readthedocs_ext/readthedocs.py", line 185, in rtd_render
    content = old_render(template, render_context)
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/sphinx/jinja2glue.py", line 194, in render
    return self.environment.get_template(template).render(context)
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/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/twisted/envs/11668/lib/python3.8/site-packages/sphinx_rtd_theme/layout.html", line 13, in top-level template code
    {%- set (_ver_major, _ver_minor, _ver_bugfix) = sphinx_version.split('.') | map('int') -%}
ValueError: too many values to unpack (expected 3)

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

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/sphinx/application.py", line 350, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 302, in build_update
    self.build(to_build,
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 368, in build
    self.write(docnames, list(updated_docnames), method)
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 563, in write
    self._write_serial(sorted(docnames))
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 573, in _write_serial
    self.write_doc(docname, doctree)
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/sphinx/builders/html/__init__.py", line 672, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/sphinx/builders/html/__init__.py", line 1103, 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 api/index.
Reason: ValueError('too many values to unpack (expected 3)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/sphinx/events.py", line 94, in emit
    results.append(listener.handler(self.app, *args))
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/pydoctor/sphinx_ext/build_apidocs.py", line 68, in on_build_finished
    output_path.rename(sphinx_files)
  File "/home/docs/.pyenv/versions/3.8.6/lib/python3.8/pathlib.py", line 1361, in rename
    self._accessor.rename(self, target)
FileNotFoundError: [Errno 2] No such file or directory: '/home/docs/checkouts/readthedocs.org/user_builds/twisted/checkouts/11668/docs/_build/html/api' -> '/home/docs/checkouts/readthedocs.org/user_builds/twisted/checkouts/11668/docs/_build/html/api.sphinx_files'

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

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/sphinx/cmd/build.py", line 279, in build_main
    app.build(args.force_all, filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/sphinx/application.py", line 358, in build
    self.events.emit('build-finished', err)
  File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/sphinx/events.py", line 105, in emit
    raise ExtensionError(__("Handler %r for event %r threw an exception") %
sphinx.errors.ExtensionError: Handler <function on_build_finished at 0x7f0cb8b205e0> for event 'build-finished' threw an exception (exception: [Errno 2] No such file or directory: '/home/docs/checkouts/readthedocs.org/user_builds/twisted/checkouts/11668/docs/_build/html/api' -> '/home/docs/checkouts/readthedocs.org/user_builds/twisted/checkouts/11668/docs/_build/html/api.sphinx_files')

Extension error (pydoctor.sphinx_ext.build_apidocs):
Handler <function on_build_finished at 0x7f0cb8b205e0> for event 'build-finished' threw an exception (exception: [Errno 2] No such file or directory: '/home/docs/checkouts/readthedocs.org/user_builds/twisted/checkouts/11668/docs/_build/html/api' -> '/home/docs/checkouts/readthedocs.org/user_builds/twisted/checkouts/11668/docs/_build/html/api.sphinx_files')

I merged forward in 451e268 which moved sphinx_rtd_theme to 1.0 from 0.5 — compatibility issue there?

@adiroiban
Copy link
Member

The main errors.

Looks like something about version formatting

{%- set (_ver_major, _ver_minor, _ver_bugfix) = sphinx_version.split('.') | map('int') -%}
ValueError: too many values to unpack (expected 3)

Might be something in pydoctor custom sphinx extension

File "/home/docs/checkouts/readthedocs.org/user_builds/twisted/envs/11668/lib/python3.8/site-packages/pydoctor/sphinx_ext/build_apidocs.py", line 68, in on_build_finished
output_path.rename(sphinx_files)
File "/home/docs/.pyenv/versions/3.8.6/lib/python3.8/pathlib.py", line 1361, in rename
self._accessor.rename(self, target)
FileNotFoundError: [Errno 2] No such file or directory: '/home/docs/checkouts/readthedocs.org/user_builds/twisted/checkouts/11668/docs/_build/html/api' -> '/home/docs/checkouts/readthedocs.org/user_builds/twisted/checkouts/11668/docs/_build/html/api.sphinx_files'

@tristanlatr
Copy link
Contributor Author

I don’t think it’s a problem with pydoctor: readthedocs/sphinx_rtd_theme#1343

@tristanlatr
Copy link
Contributor Author

The build is now successful

@tristanlatr
Copy link
Contributor Author

Please review

@twm
Copy link
Contributor

twm commented Oct 3, 2022

Awesome, thanks @tristanlatr!

@twm twm merged commit 59a7131 into trunk Oct 3, 2022
@twm twm deleted the Update-pydoctor-version branch October 3, 2022 00:09
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.

Zope interface implementations not showing in docs
4 participants