From c940b2f633211a3c79e2e70a3197257215bdcbd6 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Sun, 22 Nov 2026 19:28:08 +0900 Subject: [PATCH] mwrap 3.0.0.1: the template writes its dependency selector unquoted (mcpp 2026.11.8.1 deprecates the quoted key) tools/test_template.py reads the unquoted key as the nested tables TOML makes of it, and requires that spelling in the rendered manifest. The manifests the repository builds itself name the package by the unquoted key too (examples/sheenbidi/mcpp.toml). --- README.md | 4 ++-- README.zh.md | 4 ++-- examples/sheenbidi/mcpp.toml | 2 +- mcpp.toml | 2 +- templates/bidi/mcpp.toml.in | 2 +- tools/test_template.py | 11 +++++++---- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 426e6d1..66d0f0e 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ programs written against the module. ## Getting started ```sh -mcpp new bidi --template mcpplibs.mwrap.sheenbidi@3.0.0 +mcpp new bidi --template mcpplibs.mwrap.sheenbidi@3.0.0.1 cd bidi mcpp run ``` @@ -43,7 +43,7 @@ mirrored brackets. Run `mcpp run -- "your text"` for your own lines. ```toml [dependencies] -"mcpplibs.mwrap.sheenbidi" = "3.0.0" +mcpplibs.mwrap.sheenbidi = "3.0.0.1" ``` ```cpp diff --git a/README.zh.md b/README.zh.md index 5035777..12f977b 100644 --- a/README.zh.md +++ b/README.zh.md @@ -30,7 +30,7 @@ SheenBidi 把按逻辑顺序存储的文本转换成显示所需的视觉顺序 ## 快速开始 ```sh -mcpp new bidi --template mcpplibs.mwrap.sheenbidi@3.0.0 +mcpp new bidi --template mcpplibs.mwrap.sheenbidi@3.0.0.1 cd bidi mcpp run ``` @@ -40,7 +40,7 @@ mcpp run ```toml [dependencies] -"mcpplibs.mwrap.sheenbidi" = "3.0.0" +mcpplibs.mwrap.sheenbidi = "3.0.0.1" ``` ```cpp diff --git a/examples/sheenbidi/mcpp.toml b/examples/sheenbidi/mcpp.toml index bc5e68a..6fda1f9 100644 --- a/examples/sheenbidi/mcpp.toml +++ b/examples/sheenbidi/mcpp.toml @@ -18,4 +18,4 @@ kind = "bin" main = "conformance/BidiCharacterTest.cpp" [dependencies] -"mcpplibs.mwrap.sheenbidi" = { path = "../.." } +mcpplibs.mwrap.sheenbidi = { path = "../.." } diff --git a/mcpp.toml b/mcpp.toml index 7ce3f04..acaef58 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -2,7 +2,7 @@ [package] namespace = "mcpplibs.mwrap" name = "sheenbidi" -version = "3.0.0" +version = "3.0.0.1" description = "SheenBidi 3.0.0 C++ modules for mcpp (import mcpplibs.mwrap.sheenbidi;): the Unicode Bidirectional Algorithm (UAX #9, Unicode 17.0.0) of SheenBidi.h over compat.sheenbidi, its macros and enumerators as constants and constexpr functions" license = "Apache-2.0" authors = ["mcpp-community"] diff --git a/templates/bidi/mcpp.toml.in b/templates/bidi/mcpp.toml.in index a637560..43c2cea 100644 --- a/templates/bidi/mcpp.toml.in +++ b/templates/bidi/mcpp.toml.in @@ -7,4 +7,4 @@ kind = "bin" main = "src/main.cpp" [dependencies] -"{{self.name}}" = "{{self.version}}" +{{self.name}} = "{{self.version}}" diff --git a/tools/test_template.py b/tools/test_template.py index 81ea805..07f1ca6 100644 --- a/tools/test_template.py +++ b/tools/test_template.py @@ -48,7 +48,10 @@ def main(): project = temporary / "quickstart" manifest = project / "mcpp.toml" text = manifest.read_text() - dependency = tomllib.loads(text)["dependencies"][identity] + # The key is unquoted, so TOML reads it as one table per segment. + dependency = tomllib.loads(text)["dependencies"] + for segment in identity.split("."): + dependency = dependency[segment] options = {"version": dependency} if isinstance(dependency, str) else dependency assert options["version"] == version, options replacement = '{ path = ' + json.dumps(package.as_posix()) @@ -56,9 +59,9 @@ def main(): replacement += ', features = ' + json.dumps(options["features"]) replacement += ' }' lines = text.splitlines() - matches = [i for i, line in enumerate(lines) if line.startswith(json.dumps(identity) + " =")] - assert len(matches) == 1, "Expected exactly one qualified dependency from self.name" - lines[matches[0]] = json.dumps(identity) + " = " + replacement + matches = [i for i, line in enumerate(lines) if line.startswith(identity + " =")] + assert len(matches) == 1, "Expected exactly one unquoted qualified dependency from self.name" + lines[matches[0]] = identity + " = " + replacement manifest.write_text("\n".join(lines) + "\n") if args.index: candidate_index = args.index.resolve()