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

Allow cyrus to compile Sphinx documentation with Sphinx version 4..0 … #4542

Closed
wants to merge 1 commit into from

Conversation

lol-catz
Copy link

@lol-catz lol-catz commented Jul 3, 2023

…or greater

When compiling cyrus-imap 3.8.0 on debian 12 with Sphinx documentation cyrus fails to compile with the following error:

Exception occurred:
| File "/usr/lib/python3/dist-packages/docutils/writers/manpage.py", line 171, in init
| self.settings = settings = document.settings
| AttributeError: 'CyrusManualPageBuilder' object has no attribute 'settings'

Cause:

CyrusManualPageTranslator inherits from Sphinx' ManualPageTranslator and calls the super-class constructor as follows:

BaseTranslator.init(self, builder, *args, **kwds)

However, starting with Sphinx 2.0 it should be called with document as the first argument and builder as the second one. The old way of calling it raised a warning for some time and was completely removed in Sphinx 4.0.

…or greater

When compiling cyrus-imap 3.8.0 on debian 12 with Sphinx documentation  cyrus  fails to compile with the following  error:

Exception occurred:
|   File "/usr/lib/python3/dist-packages/docutils/writers/manpage.py", line 171, in __init__
|     self.settings = settings = document.settings
| AttributeError: 'CyrusManualPageBuilder' object has no attribute 'settings'

Cause: 

CyrusManualPageTranslator inherits from Sphinx' ManualPageTranslator and calls the super-class constructor as follows:

 BaseTranslator.__init__(self, builder, *args, **kwds)

However, starting with Sphinx 2.0 it should be called with document as the first argument and builder as the second one [1]. The old way of calling it
raised a warning for some time and was completely removed in Sphinx 4.0.
@elliefm
Copy link
Contributor

elliefm commented Jul 19, 2023

Thanks!

From what I understand from the PR description, the fix is only backward compatible as far as sphinx-build 2.0. I've just checked the system that automatically rebuilds the cyrusimap.org website, and it's currently running sphinx-build 1.4.9 -- so if we merge this PR at the moment, the website will cease to update.

We ought to get this merged, but we'll need to update sphinx-build on the system that rebuilds the website first!

@elliefm
Copy link
Contributor

elliefm commented Aug 11, 2023

Apparently, even this fix is broken for sphinx 5.0 😅

The custom CyrusManualPageBuilder/CyrusManualPageTranslator stuff didn't seem to get us anything but maintenance headaches, so we've retired it as of #4561, and we're just using the built-in man stuff instead. So I think this PR is now obsolete -- thanks, though! :)

@elliefm elliefm closed this Aug 11, 2023
This pull request was closed.
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.

2 participants