From 09a1339713fa35f866029ec088f377b8efdd0f3f Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Thu, 14 Mar 2024 16:54:56 +0000 Subject: [PATCH 1/4] Doc extensions: use StringList instead of ViewList This is more specific and avoids a mypy error --- docs/ext/operations_user_doc.py | 4 ++-- docs/ext/release_notes.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/ext/operations_user_doc.py b/docs/ext/operations_user_doc.py index 1dc05047123..e8c63436222 100644 --- a/docs/ext/operations_user_doc.py +++ b/docs/ext/operations_user_doc.py @@ -6,7 +6,7 @@ from docutils import nodes from docutils.nodes import Node -from docutils.statemachine import ViewList +from docutils.statemachine import StringList from docutils.parsers.rst import Directive from sphinx.util.nodes import nested_parse_with_titles """Custom extension to add nicely formatted documentation for the operations. @@ -81,7 +81,7 @@ def run(self) -> list[Node]: rst_lines.append(f":class:`{op.filter_name} API docs`") rst_lines.append("") - rst = ViewList() + rst = StringList() for n, rst_line in enumerate(rst_lines): rst.append(rst_line, "generated.rst", n) diff --git a/docs/ext/release_notes.py b/docs/ext/release_notes.py index 1478af5a125..c6e4ee306bf 100644 --- a/docs/ext/release_notes.py +++ b/docs/ext/release_notes.py @@ -6,7 +6,7 @@ from typing import Iterable from docutils import nodes -from docutils.statemachine import ViewList +from docutils.statemachine import StringList from docutils.parsers.rst import Directive from sphinx.errors import SphinxError from sphinx.util.nodes import nested_parse_with_titles @@ -24,10 +24,10 @@ class ReleaseNotes(Directive): has_content = True @classmethod - def make_rst(cls, note_type: str) -> ViewList: + def make_rst(cls, note_type: str) -> StringList: note_paths: Iterable[Path] = (Path() / 'docs' / 'release_notes' / 'next').glob(note_type + '*') - rst = ViewList() + rst = StringList() try: note_paths = sorted(note_paths, key=lambda p: int(p.name.split('-')[1])) except ValueError as exc: From c58c89f475a9817463796fdc217076d701ad7236 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Thu, 14 Mar 2024 16:56:19 +0000 Subject: [PATCH 2/4] Revert "Pin types-docutils to avoid #2139" Now fixed by using StringList This reverts commit c49f941e86850125610f96bea492cd40e0d06309. --- environment-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment-dev.yml b/environment-dev.yml index 9c44972d11a..df0753943f4 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -19,7 +19,7 @@ dependencies: - mypy==1.8 - types-requests - types-PyYAML - - types-docutils==0.20.0.20240311 # https://github.com/mantidproject/mantidimaging/issues/2139 + - types-docutils - pytest==7.4.* - pytest-cov==4.1.* - pytest-randomly==3.15.* From 52bd6acb8d391484ddd6befc11e0ab6a9ccfa5ad Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Thu, 14 Mar 2024 16:58:57 +0000 Subject: [PATCH 3/4] Release notes --- docs/release_notes/next/dev-2139-use-stringlist | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/release_notes/next/dev-2139-use-stringlist diff --git a/docs/release_notes/next/dev-2139-use-stringlist b/docs/release_notes/next/dev-2139-use-stringlist new file mode 100644 index 00000000000..e27358902f6 --- /dev/null +++ b/docs/release_notes/next/dev-2139-use-stringlist @@ -0,0 +1 @@ +#2139 : Doc extensions: use StringList instead of ViewList From b5977f60dcc4a1125164d2de19d1b0c4476f7671 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Thu, 14 Mar 2024 17:30:33 +0000 Subject: [PATCH 4/4] Fix table of contents for release notes --- docs/release_notes/2.7.rst | 3 +++ docs/release_notes/next/next.rst | 16 ---------------- 2 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 docs/release_notes/next/next.rst diff --git a/docs/release_notes/2.7.rst b/docs/release_notes/2.7.rst index fe7baf83781..ee4f7edda22 100644 --- a/docs/release_notes/2.7.rst +++ b/docs/release_notes/2.7.rst @@ -1,3 +1,6 @@ +Mantid Imaging 2.7 +================== + New Features ------------ - #1912 : Support sub-directories in Live viewer diff --git a/docs/release_notes/next/next.rst b/docs/release_notes/next/next.rst deleted file mode 100644 index 41c12a20ef2..00000000000 --- a/docs/release_notes/next/next.rst +++ /dev/null @@ -1,16 +0,0 @@ -Mantid Imaging next release -=========================== - -This contains changes for the next not yet released Mantid Imaging versions. - -New Features ------------- -.. release_notes:: feature - -Fixes ------ -.. release_notes:: fix - -Developer Changes ------------------ -.. release_notes:: dev