diff --git a/README.md b/README.md index f11c075..4d8aa76 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ CI run the files written are byte-identical to upstream's own `vpxenc`, and ## Getting started ```sh -mcpp new clip --template mcpplibs.mwrap.libvpx@1.17.0 +mcpp new clip --template mcpplibs.mwrap.libvpx@1.17.0.1 cd clip mcpp run -- clip.webm ``` @@ -46,7 +46,7 @@ size and the worst PSNR; given a file name it also writes the WebM. ```toml [dependencies] -"mcpplibs.mwrap.libvpx" = "1.17.0" +mcpplibs.mwrap.libvpx = "1.17.0.1" ``` ```cpp diff --git a/README.zh.md b/README.zh.md index 7b700fe..e6ff2f7 100644 --- a/README.zh.md +++ b/README.zh.md @@ -31,7 +31,7 @@ WebM(所有浏览器都能播放的容器)。上游 API 保持不变:`vpx_ ## 快速开始 ```sh -mcpp new clip --template mcpplibs.mwrap.libvpx@1.17.0 +mcpp new clip --template mcpplibs.mwrap.libvpx@1.17.0.1 cd clip mcpp run -- clip.webm ``` @@ -41,7 +41,7 @@ PSNR;给出文件名时同时写出 WebM。 ```toml [dependencies] -"mcpplibs.mwrap.libvpx" = "1.17.0" +mcpplibs.mwrap.libvpx = "1.17.0.1" ``` ```cpp diff --git a/examples/vpxwebm/mcpp.toml b/examples/vpxwebm/mcpp.toml index 6aedc9a..706c20a 100644 --- a/examples/vpxwebm/mcpp.toml +++ b/examples/vpxwebm/mcpp.toml @@ -11,5 +11,5 @@ kind = "bin" main = "src/main.cpp" [dependencies] -"mcpplibs.mwrap.libvpx" = { path = "../.." } +mcpplibs.mwrap.libvpx = { path = "../.." } diff --git a/mcpp.toml b/mcpp.toml index 4835309..ffa325d 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -2,7 +2,7 @@ [package] namespace = "mcpplibs.mwrap" name = "libvpx" -version = "1.17.0" +version = "1.17.0.1" description = "libvpx C++ modules for mcpp (import mcpplibs.mwrap.libvpx;): the libvpx 1.17.0 VP9 codec (encoder and decoder) and the libwebm 1.0.0.32 WebM container (mkvmuxer and mkvparser), over compat.libvpx and compat.libwebm; the typed controls adapted, the macros as constants and functions" license = "Apache-2.0" authors = ["mcpp-community"] diff --git a/templates/webm/mcpp.toml.in b/templates/webm/mcpp.toml.in index a637560..43c2cea 100644 --- a/templates/webm/mcpp.toml.in +++ b/templates/webm/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()