Skip to content

Commit 37fba14

Browse files
mtest 0.2.0 and 0.3.0: the static case manifest, objects that are cases, and the manifest as its own package (#732)
* mtest 0.2.0: the static case manifest, discovered groups, shards and the coverage map Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com> * autoupdate: a candidate replaces an unquoted identity key, the form mcpp recommends Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com> * autoupdate: a package below a namespace does not name the namespace's package Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com> * mtest 0.3.0: an object is a case, its type its kind; the static manifest as its own package Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com> * autoupdate: a change that adds several releases of a package is proven at the newest Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com> * ci: the downloads of the pinned mcpp are retried, as GitHub's release downloads time out at times Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com> --------- Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent cc6811b commit 37fba14

16 files changed

Lines changed: 287 additions & 21 deletions

File tree

‎.github/workflows/openkal-compat.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
shell: bash
109109
run: |
110110
archive="mcpp-${MCPP_VERSION}-linux-x86_64.tar.gz"
111-
curl -L -fsS -o "$archive" \
111+
curl -L -fsS --retry 5 --retry-all-errors --retry-delay 10 -o "$archive" \
112112
"https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/${archive}"
113113
tar -xzf "$archive"
114114
root="$PWD/mcpp-${MCPP_VERSION}-linux-x86_64"

‎.github/workflows/validate.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ jobs:
577577
# needing a newer grammar cannot pass a lint pinned to an older mcpp.
578578
- name: Download pinned mcpp
579579
run: |
580-
curl -L -fsS -o mcpp.tar.gz \
580+
curl -L -fsS --retry 5 --retry-all-errors --retry-delay 10 -o mcpp.tar.gz \
581581
"https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/mcpp-${MCPP_VERSION}-linux-x86_64.tar.gz"
582582
tar -xzf mcpp.tar.gz
583583
echo "MCPP=$PWD/mcpp-${MCPP_VERSION}-linux-x86_64/bin/mcpp" >> "$GITHUB_ENV"
@@ -1210,7 +1210,7 @@ jobs:
12101210
MCPP_ARCHIVE: mcpp-${{ env.MCPP_VERSION }}-linux-x86_64.tar.gz
12111211
MCPP_ROOT: mcpp-${{ env.MCPP_VERSION }}-linux-x86_64
12121212
run: |
1213-
curl -L -fsS -o "$MCPP_ARCHIVE" \
1213+
curl -L -fsS --retry 5 --retry-all-errors --retry-delay 10 -o "$MCPP_ARCHIVE" \
12141214
"https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/${MCPP_ARCHIVE}"
12151215
tar -xzf "$MCPP_ARCHIVE"
12161216
root="$PWD/$MCPP_ROOT"
@@ -1257,7 +1257,7 @@ jobs:
12571257
shell: bash
12581258
run: |
12591259
archive="mcpp-${MCPP_VERSION}-${{ matrix.suffix }}.tar.gz"
1260-
curl -L -fsS -o "$archive" "https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/$archive"
1260+
curl -L -fsS --retry 5 --retry-all-errors --retry-delay 10 -o "$archive" "https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/$archive"
12611261
tar -xzf "$archive"
12621262
echo "MCPP=$PWD/mcpp-${MCPP_VERSION}-${{ matrix.suffix }}/bin/mcpp" >> "$GITHUB_ENV"
12631263
- name: Immutable archive, default scaffold, strict build and loopback RPC
@@ -1380,7 +1380,7 @@ jobs:
13801380
MCPP_ARCHIVE: mcpp-${{ env.MCPP_VERSION }}-${{ matrix.suffix }}.${{ matrix.ext }}
13811381
MCPP_ROOT: mcpp-${{ env.MCPP_VERSION }}-${{ matrix.suffix }}
13821382
run: |
1383-
curl -L -fsS -o "$MCPP_ARCHIVE" \
1383+
curl -L -fsS --retry 5 --retry-all-errors --retry-delay 10 -o "$MCPP_ARCHIVE" \
13841384
"https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/${MCPP_ARCHIVE}"
13851385
case "$MCPP_ARCHIVE" in
13861386
*.zip) powershell -NoProfile -Command "Expand-Archive -Force -Path '${MCPP_ARCHIVE}' -DestinationPath '.'" ;;

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222

2323
### Added
2424

25+
- **mtest 0.3.0.** `mcpplibs.mtest`、`mcpplibs.mtest.gtest`、`mcpplibs.mtest.capi` 的 0.3.0 与新包
26+
`mcpplibs.mtest.manifest`(同一标签、同一归档):一个对象即一个用例,类型即类别(`UTest`、`CTS`、`E2E`、`Bench`,
27+
`Suite` 不声明类别),名字之后的属性说明它如何运行(资源、时限、隔离、重试、诊断)并由其声明的用例继承;静态用例
28+
清单成为独立的包,读测试的工具不必链接测试库。测试成员 `mtest`、`mtest-gtest`、`mtest-capi` 移到 0.3.0,新成员
29+
`mtest-manifest` 检验清单。
30+
- **mtest 0.2.0.** `mcpplibs.mtest`、`mcpplibs.mtest.gtest`、`mcpplibs.mtest.capi` 的 0.2.0(同一标签、同一归档):
31+
`mcpplibs.mtest.manifest` 从源文本读出测试文件声明的用例(静态用例清单);引擎增加 `[discover.<name>]` 组、
32+
用例属性、`--shard`、覆盖映射与 `list --static`。测试成员 `mtest`、`mtest-gtest`、`mtest-capi` 随之移到 0.2.0。
2533
- **mcpp.plugins 0.21.0。** CMake 交叉构建在动作运行时使用引擎给出的编译器、标志、归档器与目标约定(链接可执行文件或共享库的
2634
交叉子项目需要 mcpp 2026.11.7.1);加速器规则拥有各自的代码目标,SYCL 在一个请求中给出多个 NVIDIA 架构与 SPIR-V
2735
(mcpp#887);`plugins-progress` 写出动作的可选进度;各成员经 mcpplibs.os 0.4.0 访问系统,不包含头文件。包的下限为

‎mcpp.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ members = [
126126
"tests/examples/mtest",
127127
"tests/examples/mtest-capi",
128128
"tests/examples/mtest-gtest",
129+
"tests/examples/mtest-manifest",
129130
"tests/examples/muduo",
130131
"tests/examples/libmysqlclient",
131132
"tests/examples/mysql-connector-cpp",

‎pkgs/m/mcpplibs.mtest.capi.lua‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ package = {
2121

2222
xpm = {
2323
linux = {
24+
["0.3.0"] = {
25+
url = {
26+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
27+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
28+
},
29+
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
30+
},
31+
["0.2.0"] = {
32+
url = {
33+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
34+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
35+
},
36+
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
37+
},
2438
["0.1.0"] = {
2539
url = {
2640
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
@@ -30,6 +44,20 @@ package = {
3044
},
3145
},
3246
macosx = {
47+
["0.3.0"] = {
48+
url = {
49+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
50+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
51+
},
52+
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
53+
},
54+
["0.2.0"] = {
55+
url = {
56+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
57+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
58+
},
59+
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
60+
},
3361
["0.1.0"] = {
3462
url = {
3563
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
@@ -39,6 +67,20 @@ package = {
3967
},
4068
},
4169
windows = {
70+
["0.3.0"] = {
71+
url = {
72+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
73+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
74+
},
75+
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
76+
},
77+
["0.2.0"] = {
78+
url = {
79+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
80+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
81+
},
82+
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
83+
},
4284
["0.1.0"] = {
4385
url = {
4486
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",

‎pkgs/m/mcpplibs.mtest.gtest.lua‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ package = {
2020

2121
xpm = {
2222
linux = {
23+
["0.3.0"] = {
24+
url = {
25+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
26+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
27+
},
28+
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
29+
},
30+
["0.2.0"] = {
31+
url = {
32+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
33+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
34+
},
35+
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
36+
},
2337
["0.1.0"] = {
2438
url = {
2539
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
@@ -29,6 +43,20 @@ package = {
2943
},
3044
},
3145
macosx = {
46+
["0.3.0"] = {
47+
url = {
48+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
49+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
50+
},
51+
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
52+
},
53+
["0.2.0"] = {
54+
url = {
55+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
56+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
57+
},
58+
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
59+
},
3260
["0.1.0"] = {
3361
url = {
3462
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
@@ -38,6 +66,20 @@ package = {
3866
},
3967
},
4068
windows = {
69+
["0.3.0"] = {
70+
url = {
71+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
72+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
73+
},
74+
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
75+
},
76+
["0.2.0"] = {
77+
url = {
78+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
79+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
80+
},
81+
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
82+
},
4183
["0.1.0"] = {
4284
url = {
4385
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",

‎pkgs/m/mcpplibs.mtest.manifest.lua‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
-- mcpplibs.mtest.manifest --- mtest's static case manifest.
2+
--
3+
-- A package of mcpp-community/mtest (one tag, one archive): the cases a source
4+
-- file declares with mcpplibs.mtest -- objects, the cases they declare, their
5+
-- kinds and attributes -- read from its text without building it. A tool that
6+
-- reads tests (mtest's engine, an editor) depends on it alone.
7+
package = {
8+
spec = "1",
9+
namespace = "mcpplibs.mtest",
10+
name = "manifest",
11+
description = "mtest's static case manifest: the cases a source file declares, with their kinds and attributes, read without building it",
12+
licenses = {"Apache-2.0"},
13+
repo = "https://github.com/mcpp-community/mtest",
14+
type = "package",
15+
16+
extensions = {
17+
autoupdate = {
18+
tag = "v${version}",
19+
url = "https://github.com/mcpp-community/mtest/archive/refs/tags/${tag}.tar.gz",
20+
},
21+
},
22+
23+
xpm = {
24+
linux = {
25+
["0.3.0"] = {
26+
url = {
27+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
28+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
29+
},
30+
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
31+
},
32+
},
33+
macosx = {
34+
["0.3.0"] = {
35+
url = {
36+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
37+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
38+
},
39+
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
40+
},
41+
},
42+
windows = {
43+
["0.3.0"] = {
44+
url = {
45+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
46+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
47+
},
48+
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
49+
},
50+
},
51+
},
52+
53+
mcpp = "*/manifest/mcpp.toml",
54+
}

‎pkgs/m/mtest.lua‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ package = {
2323

2424
xpm = {
2525
linux = {
26+
["0.3.0"] = {
27+
url = {
28+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
29+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
30+
},
31+
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
32+
},
33+
["0.2.0"] = {
34+
url = {
35+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
36+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
37+
},
38+
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
39+
},
2640
["0.1.0"] = {
2741
url = {
2842
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
@@ -32,6 +46,20 @@ package = {
3246
},
3347
},
3448
macosx = {
49+
["0.3.0"] = {
50+
url = {
51+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
52+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
53+
},
54+
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
55+
},
56+
["0.2.0"] = {
57+
url = {
58+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
59+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
60+
},
61+
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
62+
},
3563
["0.1.0"] = {
3664
url = {
3765
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
@@ -41,6 +69,20 @@ package = {
4169
},
4270
},
4371
windows = {
72+
["0.3.0"] = {
73+
url = {
74+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
75+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
76+
},
77+
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
78+
},
79+
["0.2.0"] = {
80+
url = {
81+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
82+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
83+
},
84+
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
85+
},
4486
["0.1.0"] = {
4587
url = {
4688
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",

‎tests/autoupdate/ci.py‎

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,7 @@ def dependency_tables(table):
151151
candidates.append((category, path.parent.name))
152152
continue
153153
for deps in dependency_tables(manifest):
154-
nested = deps
155-
for part in namespace.split("."):
156-
nested = nested.get(part, {}) if isinstance(nested, dict) else {}
157-
if (f"{namespace}.{name}" in deps or name in deps.get(namespace, {}) or name in nested):
154+
if names_dependency(deps, namespace, name):
158155
candidates.append((category, path.parent.name))
159156
break
160157
if not candidates:
@@ -172,12 +169,24 @@ def member_manifest(member: str) -> Path:
172169
raise FileNotFoundError(f"consumer manifest not found: {member}")
173170

174171

172+
SPEC_KEYS = {"version", "path", "git", "branch", "tag", "rev", "features", "default-features",
173+
"optional", "host-module", "tools", "artifacts", "visibility", "linkage", "embed"}
174+
175+
176+
def is_spec(value) -> bool:
177+
"""A dependency's specification, as opposed to the table of a namespace below it: a version
178+
string, or a table of a specification's keys (`mcpplibs.mtest.capi = "0.2.0"` makes
179+
`mcpplibs.mtest` the table `{capi = "0.2.0"}`, which names no dependency)."""
180+
return isinstance(value, str) or (isinstance(value, dict) and bool(SPEC_KEYS & value.keys()))
181+
182+
175183
def names_dependency(deps: dict, namespace: str, name: str) -> bool:
176184
nested = deps
177185
for part in namespace.split("."):
178186
nested = nested.get(part, {}) if isinstance(nested, dict) else {}
179-
return (f"{namespace}.{name}" in deps
180-
or name in deps.get(namespace, {}) or name in nested)
187+
return (is_spec(deps.get(f"{namespace}.{name}"))
188+
or is_spec(deps.get(namespace, {}).get(name) if isinstance(deps.get(namespace), dict) else None)
189+
or (isinstance(nested, dict) and is_spec(nested.get(name))))
181190

182191

183192
# The runner platforms, by the spelling a member's `cfg(os = ...)` uses.
@@ -232,6 +241,16 @@ def condition_platforms(condition: str) -> set[str]:
232241
return out
233242

234243

244+
def version_key(version: str) -> tuple:
245+
"""A dotted version's order: its numeric parts as numbers, any other part
246+
after them as text (`0.10.0` after `0.9.0`)."""
247+
return tuple((0, int(p), "") if p.isdigit() else (1, 0, p) for p in re.split(r"[.+-]", version))
248+
249+
250+
def newest(versions: set[str]) -> str:
251+
return max(versions, key=version_key)
252+
253+
235254
def matrix(plan: Path, output: Path, base: str):
236255
build_plan = json.loads(plan.read_text(encoding="utf-8"))
237256
# A normal bump PR already contains its candidate, so discovery says up-to-date.
@@ -247,9 +266,10 @@ def matrix(plan: Path, output: Path, base: str):
247266
added = {v for plat, entries in new.items() for v in entries if v not in old.get(plat, {})}
248267
if not added:
249268
continue
250-
if len(added) != 1:
251-
raise RuntimeError(f"expected one added candidate for {info['id']}: {added}")
252-
candidate = added.pop()
269+
# A change that adds several releases of one package (two releases cut
270+
# while its pull request was open) is proven at the newest: the one
271+
# consumers are moved to, and whose archive the older ones precede.
272+
candidate = newest(added)
253273
assets = []
254274
for plat, platform in info["platforms"].items():
255275
if candidate not in platform["entries"]:
@@ -301,9 +321,12 @@ def archive_of(record):
301321

302322

303323
def replace_candidate(text: str, identity: str, version: str) -> str:
324+
# The key as a consumer writes it: the bare name under the namespace's
325+
# table, or the identity key, quoted or not (`mcpplibs.mtest.capi = ...`,
326+
# the form mcpp recommends since 2026.11.8.1).
304327
namespace, name = identity.split(":", 1)
305328
text, replacements = re.subn(
306-
rf'(?m)^(\s*(?:{re.escape(name)}|"{re.escape(namespace)}\.{re.escape(name)}")\s*=\s*(?:\{{\s*version\s*=\s*)?")[^"]+(".*)$',
329+
rf'(?m)^(\s*(?:{re.escape(name)}|"?{re.escape(namespace)}\.{re.escape(name)}"?)\s*=\s*(?:\{{\s*version\s*=\s*)?")[^"]+(".*)$',
307330
lambda m: m[1] + version + m[2], text)
308331
if not replacements:
309332
# A platform the member selects (mcpp SPEC-013).

0 commit comments

Comments
 (0)