Takes templates/extension-addon-template
through what an extension meets after its first run: validate, build, a
repository listing, install, an upgrade over the top, removal, and the
online-access gate. Every step runs a child Blender against a throwaway user
directory (BLENDER_USER_RESOURCES), so the real install is never touched.
Check-only: the witnesses are exit codes, zip members and paths, so a render
would look the same whether the contract held or broke.
Follows extension-runtime-and-packaging,
whose snippet is extension-user-data.py.
Scaffolding matches eval-mesh-datablock-name
(check() steps return codes, argparse falsifier flags, FATAL wrapper).
What it witnesses:
blender --command extension validateandbuildaccept the template, and the zip carriesblender_manifest.tomland__init__.pyat its root.validateis not a release gate. Withwheels = ["./wheels/not_shipped-1.0-py3-none-any.whl"]appended and no such file,validateexits 0 andbuildexits 1 with no zip. Only the build opens the files the manifest names.extension server-generate --repo-dirwritesindex.jsonlisting the package witharchive_url./example_addon-0.1.0.zip.- Installed with
extension install-file -r user_default, the add-on imports asbl_ext.user_default.example_addon, andbpy.utils.extension_path_user(__package__)namesextensions/.user/user_default/example_addon, beside the install treeextensions/user_default/example_addon, not inside it. - Installing 0.2.0 over 0.1.0 replaces the install tree (a file written
beside
__file__is gone) and keeps the user directory (settings.jsonsurvives).extension removedeletes the user directory too. bpy.app.online_accessisFalsein a factory-startup child andTrueunder--online-mode.
What failure each check would catch:
- exit 3 — the template stopped validating or building, or the zip lost its manifest
- exit 4 — a package whose wheel does not exist passed the release gate
(
--validate-onlylands here: it gates onvalidatealone); also exit 4 ifvalidatestarts rejecting the missing wheel, because the trap this example names would then be gone - exit 5 —
server-generatewrote no listing, or the listing does not name the package - exit 6 — install, import, upgrade or remove failed, or
__package__is notbl_ext.user_default.example_addon - exit 7 — user data lives inside the install tree, did not survive the
upgrade, or survived removal (
--data-next-to-filelands here: it stores data beside__file__) - exit 8 —
online_accessis notFalseby default andTrueunder--online-mode
| Measurement | 4.5.11 | 5.1.2 | 5.2.1 |
|---|---|---|---|
| validate / build, template | 0 / 0 | 0 / 0 | 0 / 0 |
| validate / build, missing wheel | 0 / 1 | 0 / 1 | 0 / 1 |
__package__ |
bl_ext.user_default.example_addon |
same | same |
| user data kept by 0.2.0 upgrade | yes | yes | yes |
file beside __file__ kept by upgrade |
no | no | no |
user data after remove |
deleted | deleted | deleted |
online_access default / --online-mode |
False / True | False / True | False / True |
| default exit | 0 | 0 | 0 |
--validate-only / --data-next-to-file exit |
4 / 7 | 4 / 7 | 4 / 7 |
blender --background --python extension_package_lifecycle.py --
blender --background --python extension_package_lifecycle.py -- --validate-only
blender --background --python extension_package_lifecycle.py -- --data-next-to-fileThe script starts about a dozen child Blender processes, so it takes longer than most examples.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Uncaught exception (FATAL wrapper) |
| 2 | argparse / usage |
| 3 | Template does not validate or build, or the zip lacks its manifest |
| 4 | Missing-wheel package passed the release gate (--validate-only lands here) |
| 5 | server-generate listing missing or wrong |
| 6 | Install, import, upgrade or remove failed, or __package__ wrong |
| 7 | User data inside the install tree, lost on upgrade, or kept after removal (--data-next-to-file lands here) |
| 8 | online_access default or --online-mode value wrong |
The blender-smoke workflow runs the check on Blender 5.2 LTS and 4.5 LTS
(5.1 on the weekly cron, the needs-5.1 PR label, or manual dispatch).
Smoke passes no extra flags on the happy path. Its catalog falsifiers are
--validate-only (expects exit 4) and --data-next-to-file (expects exit 7).