-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Mark Builder.write()
as final
#12767
Conversation
Thanks for the review request @AA-Turner looks interesting 😄 hopefully will be able to have a look within the next few days |
Friendly ping @chrisjsewell -- interested in your thoughts on this! A |
Sorry for the delay, I got a bit side-tracked with other things 🫣 |
Friendly ping again @chrisjsewell if you have any time. Sorry I've let this languish for a fortnight, meant to comment earlier! A |
October ping @chrisjsewell A |
# Conflicts: # CHANGES.rst # sphinx/builders/__init__.py # sphinx/builders/changes.py # sphinx/builders/html/__init__.py
Hey @AA-Turner sorry let me have a quick look over this in the next hour, before you merge 😄 |
Thanks Chris -- I was going to write to you to ask if this should be left out of 8.1, so if you have time now to review that's tremendous. A |
yep, just about finished a big release for sphinx-needs that diverted my attention 😅, which this certainly has a bearing on this useblocks/sphinx-needs#1326 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some nitpicks, but yeh I think good in principle cheers
Oh one other thing: should we make |
# Conflicts: # CHANGES.rst
Sphinx's builder implementation has added a final hint on the `write` call and introduced a `write_documents` as a more appropriate hook for processing documents [1]. This commit updates `SingleConfluenceBuilder` to no longer use `write`, except for supporting legacy versions of Sphinx that this extension still supports. [1]: sphinx-doc/sphinx#12767 Signed-off-by: James Knight <[email protected]>
Resolves #12736, #12680.
We introduce a new method,
Builder.write_documents()
to oversee writing docnames, in-betweenBuilder.write()
andBuilder.write_doc()
.Builder.write()
is then marked as final, and existing users of.write()
are migrated to the new function.An alternative design would be to introduce a new method in-between
Builder.build()
andBuilder.write()
, effectively renamingwrite_documents
in this PR towrite
andwrite
to a new name. That comes with risks, though, as if copying assets and preparing writing is not idempotent, it will not be backwards compatible.The current design is backwards compatible as users overriding
Builder.write()
will observe no runtime failures, but will recieve new static typing failures. The migration route is to useBuilder.write_documents()
.A