builder: search for its README
Browse files
scripts/build_probe_testset.py
CHANGED
|
@@ -311,10 +311,22 @@ def main() -> int:
|
|
| 311 |
manifest["n_runs"] = made
|
| 312 |
manifest["n_probes"] = sum(p["n_probes"] for p in manifest["probes"])
|
| 313 |
(out / "manifest.json").write_text(json.dumps(manifest, indent=1))
|
| 314 |
-
# The README is SOURCE, not output
|
| 315 |
-
# and the next rebuild's rmtree deleted it.
|
| 316 |
-
|
| 317 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 318 |
print(f"\n{manifest['n_probes']} probes over {made} start frames -> {out}")
|
| 319 |
return 0 if made == args.runs else 1
|
| 320 |
|
|
|
|
| 311 |
manifest["n_runs"] = made
|
| 312 |
manifest["n_probes"] = sum(p["n_probes"] for p in manifest["probes"])
|
| 313 |
(out / "manifest.json").write_text(json.dumps(manifest, indent=1))
|
| 314 |
+
# The README is SOURCE, not output — it lived in the export directory once
|
| 315 |
+
# and the next rebuild's rmtree deleted it. Searched rather than assumed:
|
| 316 |
+
# hard-coding the repo's docs/ made a clean-room rebuild die on a path that
|
| 317 |
+
# exists only here, which is the same failure calib_dir had.
|
| 318 |
+
here = Path(__file__).resolve().parent
|
| 319 |
+
for cand in (here.parents[0] / "docs" / "probe_testset_README.md",
|
| 320 |
+
here / "docs" / "probe_testset_README.md",
|
| 321 |
+
here.parent / "docs" / "probe_testset_README.md",
|
| 322 |
+
Path.cwd() / "docs" / "probe_testset_README.md"):
|
| 323 |
+
if cand.is_file():
|
| 324 |
+
shutil.copy(cand, out / "README.md")
|
| 325 |
+
break
|
| 326 |
+
else:
|
| 327 |
+
print(" note: probe_testset_README.md not found; package built without "
|
| 328 |
+
"it. Fetch docs/probe_testset_README.md from the dataset to "
|
| 329 |
+
"include it.", flush=True)
|
| 330 |
print(f"\n{manifest['n_probes']} probes over {made} start frames -> {out}")
|
| 331 |
return 0 if made == args.runs else 1
|
| 332 |
|