From 9d238e1ce442de011710da2546d3433ec643cdb4 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Tue, 16 Jul 2024 00:39:33 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20test=20fixes=20for=20sphinx=207.?= =?UTF-8?q?4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/develop/background.md | 2 +- tests/test_sphinx/test_sphinx_builds.py | 4 ++++ tests/test_sphinx/test_sphinx_builds/test_gettext.pot | 4 ++-- .../test_sphinx_builds/test_gettext_additional_targets.pot | 4 ++-- tox.ini | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/develop/background.md b/docs/develop/background.md index 4be19e03..b10efd1c 100644 --- a/docs/develop/background.md +++ b/docs/develop/background.md @@ -11,7 +11,7 @@ but there is no community standard around various syntactic choices for these fe Sphinx is a documentation generation framework written in Python. It heavily-utilizes reStructuredText syntax, which is another markup language for writing documents. In particular, Sphinx defines two extension points that are extremely useful: -**{ref}`in-line roles`** and **{ref}`block-level directives `**. +**{ref}`in-line roles`** and **{ref}`block-level directives `**. **This project is an attempt at combining the simplicity and readability of Markdown with the power and flexibility of reStructuredText and the Sphinx platform.** It diff --git a/tests/test_sphinx/test_sphinx_builds.py b/tests/test_sphinx/test_sphinx_builds.py index 7e6b13a2..1a7b5986 100644 --- a/tests/test_sphinx/test_sphinx_builds.py +++ b/tests/test_sphinx/test_sphinx_builds.py @@ -432,6 +432,8 @@ def test_gettext( output = re.sub(r"POT-Creation-Date: [0-9: +-]+", "POT-Creation-Date: ", output) output = re.sub(r"Copyright \(C\) [0-9]{4}", "Copyright (C) XXXX", output) + if sphinx.version_info < (7, 4): + output = output.replace("Python ", "Project name not set ") file_regression.check(output, extension=".pot") @@ -512,6 +514,8 @@ def test_gettext_additional_targets( output = re.sub(r"POT-Creation-Date: [0-9: +-]+", "POT-Creation-Date: ", output) output = re.sub(r"Copyright \(C\) [0-9]{4}", "Copyright (C) XXXX", output) + if sphinx.version_info < (7, 4): + output = output.replace("Python ", "Project name not set ") file_regression.check(output, extension=".pot") diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext.pot b/tests/test_sphinx/test_sphinx_builds/test_gettext.pot index 933b8b6a..786fd536 100644 --- a/tests/test_sphinx/test_sphinx_builds/test_gettext.pot +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext.pot @@ -1,12 +1,12 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) XXXX, Executable Book Project -# This file is distributed under the same license as the Python package. +# This file is distributed under the same license as the Project name not set package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python \n" +"Project-Id-Version: Project name not set \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_additional_targets.pot b/tests/test_sphinx/test_sphinx_builds/test_gettext_additional_targets.pot index 11c51d4e..a4443c6e 100644 --- a/tests/test_sphinx/test_sphinx_builds/test_gettext_additional_targets.pot +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_additional_targets.pot @@ -1,12 +1,12 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) XXXX, Executable Book Project -# This file is distributed under the same license as the Python package. +# This file is distributed under the same license as the Project name not set package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python \n" +"Project-Id-Version: Project name not set \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/tox.ini b/tox.ini index 3f27e557..25a7aaea 100644 --- a/tox.ini +++ b/tox.ini @@ -29,7 +29,7 @@ commands = pytest {posargs} extras = linkify rtd -whitelist_externals = +allowlist_externals = rm echo passenv =