Skip to content

Commit b1390c4

Browse files
marxinAA-Turner
andauthored
Fix detection for out of date files (#9360)
Co-authored-by: Adam Turner <[email protected]>
1 parent 3d25662 commit b1390c4

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

CHANGES

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Features added
1717
``:option:`--module[=foobar]``` or ``:option:`--module foobar```.
1818
Patch by Martin Liska.
1919
* #10881: autosectionlabel: Record the generated section label to the debug log.
20+
* #9360: Fix caching for now-outdated files for some builders (e.g. manpage)
21+
when there is no change in source files. Patch by Martin Liska.
2022

2123
Bugs fixed
2224
----------

sphinx/builders/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def build(
347347
with progress_message(__('checking consistency')):
348348
self.env.check_consistency()
349349
else:
350-
if method == 'update' and not docnames:
350+
if method == 'update' and (not docnames or docnames == ['__all__']):
351351
logger.info(bold(__('no targets are out of date.')))
352352
return
353353

tests/test_build_html.py

-2
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,6 @@ def test_tocdepth(app, cached_etree_parse, fname, expect):
633633
],
634634
}))
635635
@pytest.mark.sphinx('singlehtml', testroot='tocdepth')
636-
@pytest.mark.test_params(shared_result='test_build_html_tocdepth')
637636
def test_tocdepth_singlehtml(app, cached_etree_parse, fname, expect):
638637
app.build()
639638
check_xpath(cached_etree_parse(app.outdir / fname), fname, *expect)
@@ -1138,7 +1137,6 @@ def test_numfig_with_secnum_depth(app, cached_etree_parse, fname, expect):
11381137
],
11391138
}))
11401139
@pytest.mark.sphinx('singlehtml', testroot='numfig', confoverrides={'numfig': True})
1141-
@pytest.mark.test_params(shared_result='test_build_html_numfig_on')
11421140
def test_numfig_with_singlehtml(app, cached_etree_parse, fname, expect):
11431141
app.build()
11441142
check_xpath(cached_etree_parse(app.outdir / fname), fname, *expect)

tests/test_build_latex.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,7 @@ def test_latex_container(app, status, warning):
16041604

16051605
@pytest.mark.sphinx('latex', testroot='reST-code-role')
16061606
def test_latex_code_role(app):
1607-
app.build()
1607+
app.build(force_all=True)
16081608
content = (app.outdir / 'python.tex').read_text()
16091609

16101610
common_content = (

tests/test_build_manpage.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_man_pages_empty_description(app, status, warning):
4242
@pytest.mark.sphinx('man', testroot='basic',
4343
confoverrides={'man_make_section_directory': True})
4444
def test_man_make_section_directory(app, status, warning):
45-
app.build()
45+
app.build(force_all=True)
4646
assert (app.outdir / 'man1' / 'python.1').exists()
4747

4848

tests/test_build_texinfo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_texinfo(app, status, warning):
6060

6161
@pytest.mark.sphinx('texinfo', testroot='markup-rubric')
6262
def test_texinfo_rubric(app, status, warning):
63-
app.build()
63+
app.build(force_all=True)
6464

6565
output = (app.outdir / 'python.texi').read_text(encoding='utf8')
6666
assert '@heading This is a rubric' in output

0 commit comments

Comments
 (0)