From 0a8e9bca92cb8415d8c0dbb61f213a12b3755df8 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Wed, 14 Oct 2026 09:53:59 +0100 Subject: [PATCH 1/2] Add sections for more platforms --- README.md | 5 +++++ src/blurb/_template.py | 7 +++++++ tests/test_template.py | 13 +++++++++++-- tests/test_utils_globs.py | 14 ++++++++++---- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 31c64d8..6f170ad 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,11 @@ The template for the `blurb add` message looks like this: #.. section: Build #.. section: Windows #.. section: macOS + #.. section: iOS + #.. section: Android + #.. section: FreeBSD + #.. section: WebAssembly + #.. section: Unsupported platforms #.. section: IDLE #.. section: Tools/Demos #.. section: C API diff --git a/src/blurb/_template.py b/src/blurb/_template.py index b068c9e..e6d7262 100644 --- a/src/blurb/_template.py +++ b/src/blurb/_template.py @@ -24,6 +24,11 @@ #.. section: Build #.. section: Windows #.. section: macOS +#.. section: iOS +#.. section: Android +#.. section: FreeBSD +#.. section: WebAssembly +#.. section: Unsupported platforms #.. section: IDLE #.. section: Tools/Demos #.. section: C API @@ -46,12 +51,14 @@ 'C API': 'C_API', 'Core and Builtins': 'Core_and_Builtins', 'Tools/Demos': 'Tools-Demos', + 'Unsupported platforms': 'Unsupported_platforms', } _unsanitize_section = { 'C_API': 'C API', 'Core_and_Builtins': 'Core and Builtins', 'Tools-Demos': 'Tools/Demos', + 'Unsupported_platforms': 'Unsupported platforms', } diff --git a/tests/test_template.py b/tests/test_template.py index 7ba9bb5..453fc4d 100644 --- a/tests/test_template.py +++ b/tests/test_template.py @@ -3,7 +3,7 @@ import blurb._template from blurb._template import sanitize_section, unsanitize_section -UNCHANGED_SECTIONS = ('Library',) +UNCHANGED_SECTIONS = ('Library', 'iOS', 'FreeBSD', 'WebAssembly') def test_section_names(): @@ -16,6 +16,11 @@ def test_section_names(): 'Build', 'Windows', 'macOS', + 'iOS', + 'Android', + 'FreeBSD', + 'WebAssembly', + 'Unsupported platforms', 'IDLE', 'Tools/Demos', 'C API', @@ -34,6 +39,7 @@ def test_sanitize_section_no_change(section): ('C API', 'C_API'), ('Core and Builtins', 'Core_and_Builtins'), ('Tools/Demos', 'Tools-Demos'), + ('Unsupported platforms', 'Unsupported_platforms'), ), ) def test_sanitize_section_changed(section, expected): @@ -49,7 +55,10 @@ def test_unsanitize_section_no_change(section): @pytest.mark.parametrize( 'section, expected', - (('Tools-Demos', 'Tools/Demos'),), + ( + ('Tools-Demos', 'Tools/Demos'), + ('Unsupported_platforms', 'Unsupported platforms'), + ), ) def test_unsanitize_section_changed(section, expected): unsanitized = unsanitize_section(section) diff --git a/tests/test_utils_globs.py b/tests/test_utils_globs.py index aca5f84..46c5ef7 100644 --- a/tests/test_utils_globs.py +++ b/tests/test_utils_globs.py @@ -64,7 +64,8 @@ def test_glob_blurbs_section_ordering(fs) -> None: """Sections must appear in importance order, not alphabetical order. The canonical order is: Security, Core and Builtins, Library, - Documentation, Tests, Build, Windows, macOS, IDLE, Tools/Demos, C API. + Documentation, Tests, Build, Windows, macOS, iOS, Android, FreeBSD, WebAssembly, + Unsupported platforms, IDLE, Tools/Demos, C API. """ # Arrange: one entry per section fake_news_entries = [ @@ -76,9 +77,14 @@ def test_glob_blurbs_section_ordering(fs) -> None: 'Misc/NEWS.d/next/Build/2024-01-01-00-00-00.gh-issue-00005.fFFFFF.rst', 'Misc/NEWS.d/next/Windows/2024-01-01-00-00-00.gh-issue-00006.gGGGGG.rst', 'Misc/NEWS.d/next/macOS/2024-01-01-00-00-00.gh-issue-00007.hHHHHH.rst', - 'Misc/NEWS.d/next/IDLE/2024-01-01-00-00-00.gh-issue-00008.iIIIII.rst', - 'Misc/NEWS.d/next/Tools-Demos/2024-01-01-00-00-00.gh-issue-00009.jJJJJJ.rst', - 'Misc/NEWS.d/next/C_API/2024-01-01-00-00-00.gh-issue-00010.kKKKKK.rst', + 'Misc/NEWS.d/next/iOS/2024-01-01-00-00-00.gh-issue-00008.iIIIII.rst', + 'Misc/NEWS.d/next/Android/2024-01-01-00-00-00.gh-issue-00009.jJJJJJ.rst', + 'Misc/NEWS.d/next/FreeBSD/2024-01-01-00-00-00.gh-issue-00010.kKKKKK.rst', + 'Misc/NEWS.d/next/WebAssembly/2024-01-01-00-00-00.gh-issue-00011.lLLLLL.rst', + 'Misc/NEWS.d/next/Unsupported_platforms/2024-01-01-00-00-00.gh-issue-00013.nNNNNN.rst', + 'Misc/NEWS.d/next/IDLE/2024-01-01-00-00-00.gh-issue-00014.oOOOOO.rst', + 'Misc/NEWS.d/next/Tools-Demos/2024-01-01-00-00-00.gh-issue-00015.pPPPPP.rst', + 'Misc/NEWS.d/next/C_API/2024-01-01-00-00-00.gh-issue-00016.qQQQQQ.rst', ] for path in fake_news_entries: fs.create_file(path) From 48557a5ecf0c4533f98280e35940d9018ae49a7f Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Thu, 15 Oct 2026 17:16:54 +0100 Subject: [PATCH 2/2] Split WebAssembly to WASI/Emscripten --- README.md | 3 ++- src/blurb/_template.py | 3 ++- tests/test_template.py | 5 +++-- tests/test_utils_globs.py | 7 ++++--- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6f170ad..03f6f63 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,8 @@ The template for the `blurb add` message looks like this: #.. section: iOS #.. section: Android #.. section: FreeBSD - #.. section: WebAssembly + #.. section: WASI + #.. section: Emscripten #.. section: Unsupported platforms #.. section: IDLE #.. section: Tools/Demos diff --git a/src/blurb/_template.py b/src/blurb/_template.py index e6d7262..32889e1 100644 --- a/src/blurb/_template.py +++ b/src/blurb/_template.py @@ -27,7 +27,8 @@ #.. section: iOS #.. section: Android #.. section: FreeBSD -#.. section: WebAssembly +#.. section: WASI +#.. section: Emscripten #.. section: Unsupported platforms #.. section: IDLE #.. section: Tools/Demos diff --git a/tests/test_template.py b/tests/test_template.py index 453fc4d..e9a49f4 100644 --- a/tests/test_template.py +++ b/tests/test_template.py @@ -3,7 +3,7 @@ import blurb._template from blurb._template import sanitize_section, unsanitize_section -UNCHANGED_SECTIONS = ('Library', 'iOS', 'FreeBSD', 'WebAssembly') +UNCHANGED_SECTIONS = ('Library', 'iOS', 'FreeBSD', 'WASI') def test_section_names(): @@ -19,7 +19,8 @@ def test_section_names(): 'iOS', 'Android', 'FreeBSD', - 'WebAssembly', + 'WASI', + 'Emscripten', 'Unsupported platforms', 'IDLE', 'Tools/Demos', diff --git a/tests/test_utils_globs.py b/tests/test_utils_globs.py index 46c5ef7..b522b75 100644 --- a/tests/test_utils_globs.py +++ b/tests/test_utils_globs.py @@ -64,8 +64,8 @@ def test_glob_blurbs_section_ordering(fs) -> None: """Sections must appear in importance order, not alphabetical order. The canonical order is: Security, Core and Builtins, Library, - Documentation, Tests, Build, Windows, macOS, iOS, Android, FreeBSD, WebAssembly, - Unsupported platforms, IDLE, Tools/Demos, C API. + Documentation, Tests, Build, Windows, macOS, iOS, Android, FreeBSD, WASI, + Emscripten, Unsupported platforms, IDLE, Tools/Demos, C API. """ # Arrange: one entry per section fake_news_entries = [ @@ -80,7 +80,8 @@ def test_glob_blurbs_section_ordering(fs) -> None: 'Misc/NEWS.d/next/iOS/2024-01-01-00-00-00.gh-issue-00008.iIIIII.rst', 'Misc/NEWS.d/next/Android/2024-01-01-00-00-00.gh-issue-00009.jJJJJJ.rst', 'Misc/NEWS.d/next/FreeBSD/2024-01-01-00-00-00.gh-issue-00010.kKKKKK.rst', - 'Misc/NEWS.d/next/WebAssembly/2024-01-01-00-00-00.gh-issue-00011.lLLLLL.rst', + 'Misc/NEWS.d/next/WASI/2024-01-01-00-00-00.gh-issue-00011.lLLLLL.rst', + 'Misc/NEWS.d/next/Emscripten/2024-01-01-00-00-00.gh-issue-00012.mMMMMM.rst', 'Misc/NEWS.d/next/Unsupported_platforms/2024-01-01-00-00-00.gh-issue-00013.nNNNNN.rst', 'Misc/NEWS.d/next/IDLE/2024-01-01-00-00-00.gh-issue-00014.oOOOOO.rst', 'Misc/NEWS.d/next/Tools-Demos/2024-01-01-00-00-00.gh-issue-00015.pPPPPP.rst',