From c64a3cc7ab972e936957289a96e2db156f2b3da1 Mon Sep 17 00:00:00 2001 From: Dan Fuchs Date: Tue, 15 Oct 2024 13:11:48 -0500 Subject: [PATCH 1/4] DM-46777: Add a lower bound on sphinxcontrib-mermaid, revert sphinx pin * Set a lower bound on sphinxcontrib-mermaid to <=1 * Revert the Sphinx pin because this fixes the compatibility issue * Ditch the `mermaid_version` pin because this fixes https://github.com/mgaitan/sphinxcontrib-mermaid/issues/110 --- changelog.d/20241010_133336_danfuchs_mermaid_compat.md | 4 ++++ pyproject.toml | 4 ++-- src/documenteer/conf/guide.py | 5 ----- 3 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 changelog.d/20241010_133336_danfuchs_mermaid_compat.md diff --git a/changelog.d/20241010_133336_danfuchs_mermaid_compat.md b/changelog.d/20241010_133336_danfuchs_mermaid_compat.md new file mode 100644 index 00000000..c1a4bad6 --- /dev/null +++ b/changelog.d/20241010_133336_danfuchs_mermaid_compat.md @@ -0,0 +1,4 @@ +### Bug fixes + +- Bump `sphinxcontrib-mermaid` to >= 1, which fixes an incompatibility with sphinx==1.8.1, and allows us to unpin the version of mermaid JS. + diff --git a/pyproject.toml b/pyproject.toml index 27f36086..bd36efa9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ requires-python = ">=3.11" dynamic = ["version"] dependencies = [ "docutils>=0.20", # solves an extra div bug with the bibliography directive - "Sphinx>=7,<8.1.0", # Consistent docutils constraint, mermaid compatibility + "Sphinx>=7", # Consistent docutils constraint "PyYAML", "GitPython", "requests", @@ -71,7 +71,7 @@ guide = [ "myst-parser", "myst-nb", "markdown-it-py[linkify]", - "sphinxcontrib-mermaid", + "sphinxcontrib-mermaid>=1", "sphinxext-opengraph", "sphinxcontrib-redoc", "sphinxcontrib-jquery", diff --git a/src/documenteer/conf/guide.py b/src/documenteer/conf/guide.py index a6676b41..2bc0f023 100644 --- a/src/documenteer/conf/guide.py +++ b/src/documenteer/conf/guide.py @@ -103,7 +103,6 @@ "myst_enable_extensions", # MERMAID "mermaid_output_format", - "mermaid_version", # OPENGRAPH "ogp_site_url", "ogp_site_name", @@ -398,10 +397,6 @@ # Mermaid CLI installation mermaid_output_format = "raw" -# Temporary workaround for not getting mermaid 10 successfully from unpkg -# https://github.com/mgaitan/sphinxcontrib-mermaid/issues/110 -mermaid_version = "9.4.0" - # ============================================================================ # #OPENGRAPH OpenGraph diagram support # https://github.com/wpilibsuite/sphinxext-opengraph From ff81b9103c39d352de48fbc0218b4dd9e19642de Mon Sep 17 00:00:00 2001 From: Dan Fuchs Date: Tue, 15 Oct 2024 13:48:54 -0500 Subject: [PATCH 2/4] mpyp 1.12 doesn't consider this reexported anymore, but it's fine --- src/documenteer/ext/remotecodeblock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/documenteer/ext/remotecodeblock.py b/src/documenteer/ext/remotecodeblock.py index 15c44844..e4c82f9b 100644 --- a/src/documenteer/ext/remotecodeblock.py +++ b/src/documenteer/ext/remotecodeblock.py @@ -7,7 +7,7 @@ from docutils import nodes from docutils.parsers.rst import Directive, directives from sphinx.directives.code import LiteralIncludeReader, container_wrapper -from sphinx.util import logging, parselinenos +from sphinx.util import logging, parselinenos # type: ignore[attr-defined] from sphinx.util.nodes import set_source_info from ..requestsutils import requests_retry_session From 33728f3a95d5b177bc7af7f046f28c113f5ef203 Mon Sep 17 00:00:00 2001 From: Dan Fuchs Date: Tue, 15 Oct 2024 15:11:25 -0500 Subject: [PATCH 3/4] Remove type ignores because they behave differently on this branch for some reason, plus a bunch of formatting --- src/documenteer/ext/remotecodeblock.py | 2 +- src/documenteer/stackdocs/doxygen.py | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/documenteer/ext/remotecodeblock.py b/src/documenteer/ext/remotecodeblock.py index e4c82f9b..15c44844 100644 --- a/src/documenteer/ext/remotecodeblock.py +++ b/src/documenteer/ext/remotecodeblock.py @@ -7,7 +7,7 @@ from docutils import nodes from docutils.parsers.rst import Directive, directives from sphinx.directives.code import LiteralIncludeReader, container_wrapper -from sphinx.util import logging, parselinenos # type: ignore[attr-defined] +from sphinx.util import logging, parselinenos from sphinx.util.nodes import set_source_info from ..requestsutils import requests_retry_session diff --git a/src/documenteer/stackdocs/doxygen.py b/src/documenteer/stackdocs/doxygen.py index 56cb1712..a8809e47 100644 --- a/src/documenteer/stackdocs/doxygen.py +++ b/src/documenteer/stackdocs/doxygen.py @@ -1,5 +1,4 @@ -"""Configuration and execution of Doxygen at the stack level. -""" +"""Configuration and execution of Doxygen at the stack level.""" __all__ = [ "DoxygenConfiguration", @@ -333,11 +332,7 @@ def render(self) -> str: self._render_path_list(lines, tag_name, value) elif tag_field.type == List[str]: self._render_str_list(lines, tag_name, value) - elif ( - tag_field.type == Path - or tag_field.type - == Optional[Path] # type: ignore[comparison-overlap] - ): + elif tag_field.type == Path or tag_field.type == Optional[Path]: self._render_path(lines, tag_name, value) return "\n".join(lines) + "\n" From 5748fa3cc12fdebe89a3134d3d9d773676575cb0 Mon Sep 17 00:00:00 2001 From: Dan Fuchs Date: Tue, 15 Oct 2024 14:20:52 -0500 Subject: [PATCH 4/4] Release 1.4.2 --- CHANGELOG.md | 7 +++++++ changelog.d/20241010_133336_danfuchs_mermaid_compat.md | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 changelog.d/20241010_133336_danfuchs_mermaid_compat.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 3146fced..0b691423 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ + +## 1.4.2 (2024-10-15) + +### Bug fixes + +- Bump `sphinxcontrib-mermaid` to >= 1, which fixes an incompatibility with sphinx==1.8.1, and allows us to unpin the version of mermaid JS. + ## 1.4.1 (2024-10-10) diff --git a/changelog.d/20241010_133336_danfuchs_mermaid_compat.md b/changelog.d/20241010_133336_danfuchs_mermaid_compat.md deleted file mode 100644 index c1a4bad6..00000000 --- a/changelog.d/20241010_133336_danfuchs_mermaid_compat.md +++ /dev/null @@ -1,4 +0,0 @@ -### Bug fixes - -- Bump `sphinxcontrib-mermaid` to >= 1, which fixes an incompatibility with sphinx==1.8.1, and allows us to unpin the version of mermaid JS. -