diff --git a/README.md b/README.md index 776732d..0adaf4c 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,14 @@ ## Add The Package ```sh -mcpp new llama_app --template mcpplibs.mwrap.llamacpp@b10069 +mcpp new llama_app --template mcpplibs.mwrap.llamacpp@b10069.1 cd llama_app mcpp run ``` ```toml [dependencies] -mcpplibs.mwrap.llamacpp = "b10069" +mcpplibs.mwrap.llamacpp = "b10069.1" ``` ## Minimal CPU Program @@ -58,7 +58,7 @@ Shader generation, libstdc++ constraints and driver boundaries are in [usage](do ## Supported Boundary -Pin `b10069` exactly; it is not a semver range. `.macros` exposes mapped constants. +Pin `b10069.1` exactly; it is not a semver range. `.macros` exposes mapped constants. Model quality and unsupported GPU configurations are not implied by the CPU template. [Upstream policy](docs/upstream-update-policy.md) · [Validation](docs/validation/b10069.md) · [Apache-2.0](LICENSE) diff --git a/README.zh.md b/README.zh.md index 42bc09f..6d157fd 100644 --- a/README.zh.md +++ b/README.zh.md @@ -19,14 +19,14 @@ ## 添加依赖 ```sh -mcpp new llama_app --template mcpplibs.mwrap.llamacpp@b10069 +mcpp new llama_app --template mcpplibs.mwrap.llamacpp@b10069.1 cd llama_app mcpp run ``` ```toml [dependencies] -mcpplibs.mwrap.llamacpp = "b10069" +mcpplibs.mwrap.llamacpp = "b10069.1" ``` ## 最小 CPU 程序 @@ -58,7 +58,7 @@ shader 生成、libstdc++ 限制及驱动边界见[使用说明](docs/usage.md) ## 支持边界 -精确固定 `b10069`,不使用 semver 范围;`.macros` 导出映射常量。 +精确固定 `b10069.1`,不使用 semver 范围;`.macros` 导出映射常量。 CPU 模板通过不代表模型质量或未支持 GPU 配置通过。 [上游策略](docs/upstream-update-policy.md) · [验证](docs/validation/b10069.md) · [Apache-2.0](LICENSE) diff --git a/docs/usage.md b/docs/usage.md index 3d541bf..abbeade 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -243,7 +243,7 @@ for exact evidence and remaining release gates. The b10069 package adds a runnable default template. After that version is indexed: ```sh -mcpp new my-llama --template mcpplibs.mwrap.llamacpp@b10069 +mcpp new my-llama --template mcpplibs.mwrap.llamacpp@b10069.1 cd my-llama mcpp run ``` diff --git a/examples/chat-cpu/mcpp.toml b/examples/chat-cpu/mcpp.toml index 935f32f..12864dc 100644 --- a/examples/chat-cpu/mcpp.toml +++ b/examples/chat-cpu/mcpp.toml @@ -8,4 +8,4 @@ kind = "bin" main = "src/main.cpp" [dependencies] -"mcpplibs.mwrap.llamacpp" = { path = "../.." } +mcpplibs.mwrap.llamacpp = { path = "../.." } diff --git a/examples/chat-metal/mcpp.toml b/examples/chat-metal/mcpp.toml index 2e34391..ab25a04 100644 --- a/examples/chat-metal/mcpp.toml +++ b/examples/chat-metal/mcpp.toml @@ -8,4 +8,4 @@ kind = "bin" main = "src/main.cpp" [dependencies] -"mcpplibs.mwrap.llamacpp" = { path = "../..", features = ["backend-metal"] } +mcpplibs.mwrap.llamacpp = { path = "../..", features = ["backend-metal"] } diff --git a/examples/chat-vulkan/mcpp.toml b/examples/chat-vulkan/mcpp.toml index 3b84b19..ba6dbac 100644 --- a/examples/chat-vulkan/mcpp.toml +++ b/examples/chat-vulkan/mcpp.toml @@ -13,4 +13,4 @@ kind = "bin" main = "src/main.cpp" [dependencies] -"mcpplibs.mwrap.llamacpp" = { path = "../..", features = ["backend-vulkan"] } +mcpplibs.mwrap.llamacpp = { path = "../..", features = ["backend-vulkan"] } diff --git a/mcpp.toml b/mcpp.toml index bf143b0..559dea4 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -2,7 +2,7 @@ [package] namespace = "mcpplibs.mwrap" name = "llamacpp" -version = "b10069" +version = "b10069.1" description = "C++23 module package for llama.cpp b10069" license = "Apache-2.0" authors = ["mcpp-community"] diff --git a/templates/cpu/mcpp.toml.in b/templates/cpu/mcpp.toml.in index 9077430..8b5cbb1 100644 --- a/templates/cpu/mcpp.toml.in +++ b/templates/cpu/mcpp.toml.in @@ -4,4 +4,4 @@ version = "0.1.0" description = "llama.cpp CPU quickstart" [dependencies] -"{{self.name}}" = "{{self.version}}" +{{self.name}} = "{{self.version}}" diff --git a/tools/test_template.py b/tools/test_template.py index 0a9955c..1c31348 100644 --- a/tools/test_template.py +++ b/tools/test_template.py @@ -43,7 +43,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()) @@ -51,9 +54,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") command = [args.mcpp, "run", "--toolchain", args.toolchain] if args.run_arg: