Skip to content

Commit 9fd2eb8

Browse files
Fix for objects.inv (#1552)
This PR tweaks the `qml` build tool such that the generated objects.inv files match the naming and uris for the demos on pennylane.ai. This PR should fix #1550. Note: This has been tested locally. ~We should verify it works when building all demos as wel.~ Tested for all demos successfully [here](https://github.com/PennyLaneAI/qml/actions/runs/17866805882) --------- Co-authored-by: Alan Martin <[email protected]>
1 parent e398b4e commit 9fd2eb8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/qml/lib/demo.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def build(
226226
for demo in demos:
227227
logger.info("Loading objects.inv for '%s'", demo.name)
228228
demo_inv = soi.Inventory(
229-
ctx.repo_root / "demos" / demo.name / "objects.inv"
229+
ctx.build_dir / f"{demo.name}_objects.inv"
230230
)
231231

232232
# Only add entries that don't already exist in the merged inventory file
@@ -274,7 +274,7 @@ def _build_demo(
274274
quiet: bool,
275275
dev: bool,
276276
):
277-
out_dir = ctx.repo_root / "demos" / demo.name
277+
out_dir = ctx.repo_root / "demos"
278278
fs.clean_dir(out_dir)
279279

280280
generate_requirements(ctx, demo, dev, out_dir / "requirements.txt")
@@ -333,7 +333,7 @@ def _build_demo(
333333

334334
# Move the objects.inv file so we can merge them once all the demos are built
335335
if target is BuildTarget.HTML:
336-
fs.copy_any(ctx.build_dir / "html/objects.inv", out_dir)
336+
fs.copy_any(ctx.build_dir / "html/objects.inv", ctx.build_dir / f"{demo.name}_objects.inv")
337337

338338

339339
def _package_demo(
@@ -357,7 +357,7 @@ def _package_demo(
357357
fs.clean_dir(dest)
358358

359359
with open(
360-
(sphinx_output / "demos" / demo.name / demo.name).with_suffix(".fjson"), "r"
360+
(sphinx_output / "demos" / demo.name).with_suffix(".fjson"), "r"
361361
) as f:
362362
html_body = json.load(f)["body"]
363363

0 commit comments

Comments
 (0)