Skip to content

Commit 6689f1a

Browse files
TMHSDigitalclaude
andcommitted
fix: extension-package-lifecycle and the template CI build after the [build] table
The template manifest now ends with a [build] table (#531). extension-package-lifecycle appended wheels = [...] to the end of a copy of it, so the key landed inside [build], build never looked for the missing wheel, and the example failed its check on every runner. It now inserts the key before the first table header. Separately, extension build does not create --output-dir, so the template's workflow and the smoke step that mirrors it failed on Linux: both now mkdir -p it first. Live-run proven on Blender 5.2.1 LTS and 4.5.14 LTS: the example exits 0, --ship-wheel exits 4 and --data-next-to-file exits 7, as catalogued. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LpkeXRvikhJZSVGBFM91Dv Signed-off-by: TM Hospitality Strategies <TMHospitalityStrategies@gmail.com>
1 parent f1d6296 commit 6689f1a

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎.github/workflows/blender-smoke.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ jobs:
267267
if: matrix.shard == 0
268268
run: |
269269
set -euo pipefail
270+
mkdir -p "$RUNNER_TEMP/extbuild" # build does not create --output-dir
270271
"$BLENDER" --command extension build \
271272
--source-dir templates/extension-addon-template --output-dir "$RUNNER_TEMP/extbuild"
272273
zip=$(ls "$RUNNER_TEMP"/extbuild/*.zip | head -1)

‎examples/extension-package-lifecycle/extension_package_lifecycle.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,15 @@ def check_wheel_trap(work, ship_wheel):
9696
"""validate parses the manifest; only build opens the files it names."""
9797
src = copy_template(os.path.join(work, "wheel_src"))
9898
manifest = os.path.join(src, "blender_manifest.toml")
99-
with open(manifest, "a", encoding="utf-8") as fh:
100-
fh.write(f'\nwheels = ["{MISSING_WHEEL}"]\n')
99+
# A top-level key must come before the manifest's first [table] (the
100+
# template ends with [build]); appended after it, `wheels` would belong to
101+
# that table and build would never look for the file.
102+
with open(manifest, encoding="utf-8") as fh:
103+
lines = fh.read().split("\n")
104+
at = next((i for i, line in enumerate(lines) if line.startswith("[")), len(lines))
105+
lines.insert(at, f'wheels = ["{MISSING_WHEEL}"]\n')
106+
with open(manifest, "w", encoding="utf-8") as fh:
107+
fh.write("\n".join(lines))
101108
if ship_wheel: # falsification: the named wheel exists, so build has nothing to reject
102109
wheel = os.path.normpath(os.path.join(src, MISSING_WHEEL))
103110
os.makedirs(os.path.dirname(wheel))

‎templates/extension-addon-template/.github/workflows/blender.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ jobs:
9393
# `build`, not `validate`: build also checks the files it packs.
9494
run: |
9595
set -euo pipefail
96+
mkdir -p "$RUNNER_TEMP/dist" # build does not create --output-dir
9697
"$BLENDER" --command extension build --source-dir . --output-dir "$RUNNER_TEMP/dist"
9798
ls -l "$RUNNER_TEMP/dist"
9899

0 commit comments

Comments
 (0)