Skip to content

Commit 0f35a69

Browse files
author
Release Manager
committed
gh-37334: Preparation for Sphinx 7 Based on #37129, we adjust sage for Sphinx 7. Mainly, - (once again) `sage_autodoc` is updated based on the source file of Sphinx 7. Before the arrival of Sphinx 8, hopefully, we should remove `sage_autodoc`! <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> - #37129 <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #37334 Reported by: Kwankyu Lee Reviewer(s):
2 parents e2c3fe9 + 0ec4126 commit 0f35a69

File tree

5 files changed

+567
-500
lines changed

5 files changed

+567
-500
lines changed

src/sage_docbuild/builders.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,10 @@ def f(self, *args, **kwds):
171171
if build_options.ABORT_ON_ERROR:
172172
raise Exception("Non-exception during docbuild: %s" % (e,), e)
173173

174-
if "/latex" in output_dir:
175-
logger.warning("LaTeX file written to {}".format(output_dir))
176-
else:
177-
logger.warning(
178-
"Build finished. The built documents can be found in {}".
179-
format(output_dir))
174+
if type == 'latex':
175+
logger.warning(f"LaTeX files can be found in {output_dir}.")
176+
elif type != 'inventory':
177+
logger.warning(f"Build finished. The built documents can be found in {output_dir}.")
180178

181179
f.is_output_format = True
182180
return f
@@ -298,7 +296,7 @@ def pdf(self):
298296

299297
if subprocess.call(make_target % (tex_dir, command, pdf_dir), close_fds=False, shell=True):
300298
raise RuntimeError(error_message % (command, tex_dir))
301-
logger.warning("Build finished. The built documents can be found in %s", pdf_dir)
299+
logger.warning(f"Build finished. The built documents can be found in {pdf_dir}.")
302300

303301
def clean(self, *args):
304302
shutil.rmtree(self._doctrees_dir())

src/sage_docbuild/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ def setup(app):
869869

870870
# When building the standard docs, app.srcdir is set to SAGE_DOC_SRC +
871871
# 'LANGUAGE/DOCNAME'.
872-
if app.srcdir.startswith(SAGE_DOC_SRC):
872+
if app.srcdir.is_relative_to(SAGE_DOC_SRC):
873873
app.add_config_value('intersphinx_mapping', {}, False)
874874
app.add_config_value('intersphinx_cache_limit', 5, False)
875875
app.add_config_value('intersphinx_disabled_reftypes', [], False)

src/sage_docbuild/ext/inventory_builder.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
"""
32
Inventory builder
43
@@ -23,10 +22,9 @@ class InventoryBuilder(DummyBuilder):
2322
A customized builder which only generates intersphinx "object.inv"
2423
inventory files. The documentation files are not written.
2524
"""
26-
2725
name = "inventory"
2826
format = "inventory"
29-
epilog = "The inventory files are in %(outdir)s."
27+
epilog = "The inventory file is in %(outdir)s."
3028

3129
def get_outdated_docs(self) -> Iterable[str]:
3230
"""

0 commit comments

Comments
 (0)