From d2962b8fe8ec510399a65af7ac6a873eda30a5e0 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Sun, 22 Nov 2026 19:28:07 +0900 Subject: [PATCH] mwrap 1.0.5.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 (tests/c_api/mcpp.toml tools/run_conformance.py). --- README.md | 4 ++-- README.zh.md | 4 ++-- mcpp.toml | 2 +- templates/pipeline/mcpp.toml.in | 2 +- tests/c_api/mcpp.toml | 2 +- tools/run_conformance.py | 2 +- tools/test_template.py | 11 +++++++---- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 11bfefe..ce72239 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ module instead of the headers. ## Getting started ```sh -mcpp new pipeline --template mcpplibs.mwrap.concurrentqueue@1.0.5 +mcpp new pipeline --template mcpplibs.mwrap.concurrentqueue@1.0.5.1 cd pipeline mcpp run ``` @@ -39,7 +39,7 @@ queue with a timeout and count primes. ```toml [dependencies] -"mcpplibs.mwrap.concurrentqueue" = "1.0.5" +mcpplibs.mwrap.concurrentqueue = "1.0.5.1" ``` ```cpp diff --git a/README.zh.md b/README.zh.md index 0740ef0..07954dd 100644 --- a/README.zh.md +++ b/README.zh.md @@ -26,7 +26,7 @@ ## 快速开始 ```sh -mcpp new pipeline --template mcpplibs.mwrap.concurrentqueue@1.0.5 +mcpp new pipeline --template mcpplibs.mwrap.concurrentqueue@1.0.5.1 cd pipeline mcpp run ``` @@ -36,7 +36,7 @@ mcpp run ```toml [dependencies] -"mcpplibs.mwrap.concurrentqueue" = "1.0.5" +mcpplibs.mwrap.concurrentqueue = "1.0.5.1" ``` ```cpp diff --git a/mcpp.toml b/mcpp.toml index f6f102c..17fa34b 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -2,7 +2,7 @@ [package] namespace = "mcpplibs.mwrap" name = "concurrentqueue" -version = "1.0.5" +version = "1.0.5.1" description = "moodycamel::ConcurrentQueue 1.0.5 C++ modules for mcpp (import mcpplibs.mwrap.concurrentqueue;): the lock-free MPMC queue, its blocking variant and semaphore over compat.concurrentqueue, the C API behind the c-api feature" license = "Apache-2.0" authors = ["mcpp-community"] diff --git a/templates/pipeline/mcpp.toml.in b/templates/pipeline/mcpp.toml.in index a637560..43c2cea 100644 --- a/templates/pipeline/mcpp.toml.in +++ b/templates/pipeline/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/tests/c_api/mcpp.toml b/tests/c_api/mcpp.toml index 6f66556..1422d81 100644 --- a/tests/c_api/mcpp.toml +++ b/tests/c_api/mcpp.toml @@ -6,7 +6,7 @@ version = "0.1.0" description = "mcpplibs.mwrap.concurrentqueue with the c-api and no-thread-local features" [dependencies] -"mcpplibs.mwrap.concurrentqueue" = { path = "../..", features = ["c-api", "no-thread-local"] } +mcpplibs.mwrap.concurrentqueue = { path = "../..", features = ["c-api", "no-thread-local"] } [dev-dependencies] compat.gtest = "1.15.2" diff --git a/tools/run_conformance.py b/tools/run_conformance.py index a578408..847bb04 100644 --- a/tools/run_conformance.py +++ b/tools/run_conformance.py @@ -64,7 +64,7 @@ sources = ["tests/common/*.cpp", "tests/unittests/mallocmacro.cpp"] [dependencies] -"mcpplibs.mwrap.concurrentqueue" = {{ path = {root}, features = ["c-api"] }} +mcpplibs.mwrap.concurrentqueue = {{ path = {root}, features = ["c-api"] }} ''' 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()