diff --git a/README.md b/README.md index 31c64d8..03f6f63 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,12 @@ The template for the `blurb add` message looks like this: #.. section: Build #.. section: Windows #.. section: macOS + #.. section: iOS + #.. section: Android + #.. section: FreeBSD + #.. section: WASI + #.. section: Emscripten + #.. 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..32889e1 100644 --- a/src/blurb/_template.py +++ b/src/blurb/_template.py @@ -24,6 +24,12 @@ #.. section: Build #.. section: Windows #.. section: macOS +#.. section: iOS +#.. section: Android +#.. section: FreeBSD +#.. section: WASI +#.. section: Emscripten +#.. section: Unsupported platforms #.. section: IDLE #.. section: Tools/Demos #.. section: C API @@ -46,12 +52,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..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',) +UNCHANGED_SECTIONS = ('Library', 'iOS', 'FreeBSD', 'WASI') def test_section_names(): @@ -16,6 +16,12 @@ def test_section_names(): 'Build', 'Windows', 'macOS', + 'iOS', + 'Android', + 'FreeBSD', + 'WASI', + 'Emscripten', + 'Unsupported platforms', 'IDLE', 'Tools/Demos', 'C API', @@ -34,6 +40,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 +56,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..b522b75 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, WASI, + Emscripten, Unsupported platforms, IDLE, Tools/Demos, C API. """ # Arrange: one entry per section fake_news_entries = [ @@ -76,9 +77,15 @@ 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/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', + '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)