From d3ab80c0dda6f69348f356e89f3db49ef2974aa1 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 17 Jun 2021 22:49:53 +0200 Subject: [PATCH 1/4] Fix detection when targets are out of date. Fixes #9359. --- sphinx/builders/__init__.py | 2 +- tests/test_build_html.py | 2 -- tests/test_build_latex.py | 2 +- tests/test_build_manpage.py | 2 +- tests/test_build_texinfo.py | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index e70d1956c98..6ca77c4bc2b 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -347,7 +347,7 @@ def build( with progress_message(__('checking consistency')): self.env.check_consistency() else: - if method == 'update' and not docnames: + if method == 'update' and (not docnames or docnames == ['__all__']): logger.info(bold(__('no targets are out of date.'))) return diff --git a/tests/test_build_html.py b/tests/test_build_html.py index 138f8a9c129..0d19de4cae7 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -633,7 +633,6 @@ def test_tocdepth(app, cached_etree_parse, fname, expect): ], })) @pytest.mark.sphinx('singlehtml', testroot='tocdepth') -@pytest.mark.test_params(shared_result='test_build_html_tocdepth') def test_tocdepth_singlehtml(app, cached_etree_parse, fname, expect): app.build() 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): ], })) @pytest.mark.sphinx('singlehtml', testroot='numfig', confoverrides={'numfig': True}) -@pytest.mark.test_params(shared_result='test_build_html_numfig_on') def test_numfig_with_singlehtml(app, cached_etree_parse, fname, expect): app.build() check_xpath(cached_etree_parse(app.outdir / fname), fname, *expect) diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index 8f7a2e85acc..a97bebd3da7 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -1604,7 +1604,7 @@ def test_latex_container(app, status, warning): @pytest.mark.sphinx('latex', testroot='reST-code-role') def test_latex_code_role(app): - app.build() + app.build(True) content = (app.outdir / 'python.tex').read_text() common_content = ( diff --git a/tests/test_build_manpage.py b/tests/test_build_manpage.py index 8509684d179..6390cd9bab5 100644 --- a/tests/test_build_manpage.py +++ b/tests/test_build_manpage.py @@ -42,7 +42,7 @@ def test_man_pages_empty_description(app, status, warning): @pytest.mark.sphinx('man', testroot='basic', confoverrides={'man_make_section_directory': True}) def test_man_make_section_directory(app, status, warning): - app.build() + app.build(True) assert (app.outdir / 'man1' / 'python.1').exists() diff --git a/tests/test_build_texinfo.py b/tests/test_build_texinfo.py index b33a7e01fc3..8a65801ca3a 100644 --- a/tests/test_build_texinfo.py +++ b/tests/test_build_texinfo.py @@ -60,7 +60,7 @@ def test_texinfo(app, status, warning): @pytest.mark.sphinx('texinfo', testroot='markup-rubric') def test_texinfo_rubric(app, status, warning): - app.build() + app.build(True) output = (app.outdir / 'python.texi').read_text(encoding='utf8') assert '@heading This is a rubric' in output From 4a240ce6824a9f2f123fa25a0cae41d24498faf6 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 5 Oct 2022 11:43:13 +0200 Subject: [PATCH 2/4] Add kwargs. --- tests/test_build_latex.py | 2 +- tests/test_build_manpage.py | 2 +- tests/test_build_texinfo.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index a97bebd3da7..efdbcb29878 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -1604,7 +1604,7 @@ def test_latex_container(app, status, warning): @pytest.mark.sphinx('latex', testroot='reST-code-role') def test_latex_code_role(app): - app.build(True) + app.build(force_all=True) content = (app.outdir / 'python.tex').read_text() common_content = ( diff --git a/tests/test_build_manpage.py b/tests/test_build_manpage.py index 6390cd9bab5..6c34e1771d5 100644 --- a/tests/test_build_manpage.py +++ b/tests/test_build_manpage.py @@ -42,7 +42,7 @@ def test_man_pages_empty_description(app, status, warning): @pytest.mark.sphinx('man', testroot='basic', confoverrides={'man_make_section_directory': True}) def test_man_make_section_directory(app, status, warning): - app.build(True) + app.build(force_all=True) assert (app.outdir / 'man1' / 'python.1').exists() diff --git a/tests/test_build_texinfo.py b/tests/test_build_texinfo.py index 8a65801ca3a..c60dd994b7c 100644 --- a/tests/test_build_texinfo.py +++ b/tests/test_build_texinfo.py @@ -60,7 +60,7 @@ def test_texinfo(app, status, warning): @pytest.mark.sphinx('texinfo', testroot='markup-rubric') def test_texinfo_rubric(app, status, warning): - app.build(True) + app.build(force_all=True) output = (app.outdir / 'python.texi').read_text(encoding='utf8') assert '@heading This is a rubric' in output From 6cc5945173696dda53c86edbe07cf1027f9e4f43 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 5 Oct 2022 15:30:43 +0200 Subject: [PATCH 3/4] Add CHANGES entry. --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index e3c91d72e01..7753c9296f7 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,8 @@ Features added * #10840: One can cross-reference including an option value: ``:option:`--module=foobar```. Patch by Martin Liska. * #10881: autosectionlabel: Record the generated section label to the debug log. +* #9360: Fix caching for now-outdates files for some builders when there is not change + in source files. Patch by Martin Liska. Bugs fixed ---------- From 1c69d4d1642d28b59f537ff3db5c52f9b8f2dd75 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Wed, 5 Oct 2022 14:43:41 +0100 Subject: [PATCH 4/4] Update CHANGES --- CHANGES | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 7753c9296f7..38b9939c23c 100644 --- a/CHANGES +++ b/CHANGES @@ -16,8 +16,8 @@ Features added * #10840: One can cross-reference including an option value: ``:option:`--module=foobar```. Patch by Martin Liska. * #10881: autosectionlabel: Record the generated section label to the debug log. -* #9360: Fix caching for now-outdates files for some builders when there is not change - in source files. Patch by Martin Liska. +* #9360: Fix caching for now-outdated files for some builders (e.g. manpage) + when there is no change in source files. Patch by Martin Liska. Bugs fixed ----------