blender/scripts/modules
Campbell Barton 67ddb0e1a5 Extensions: detect external changes on startup & loading preferences
Changes to an extensions manifest weren't accounted for.
This was particularly a problem for "System" extensions which aren't
intended to be managed inside Blender however the problem existed for
any changes made outside of Blender.

Now enabled extensions are checked on startup to ensure:

- They are compatible with Blender.
- The Python wheels are synchronized.

Resolves #123645.

Details:

- Any extension incompatibilities prevent the add-on being enabled
  with a message printing the reason for it being disabled.

- Incompatible add-ons are kept enabled in the preferences to avoid
  loosing their own preferences and allow for an upgrade to restore
  compatibility.

- To avoid slowing down Blender's startup:

  - Checks are skipped when no extensions are enabled
    (as is the case for `--factory-startup` & running tests).
  - Compatibility data is cached so in common case,
    the cache is loaded and all enabled extensions `stat` their
    manifests to detect changes without having to parse them.
  - The cache is re-generated if any extensions change or the
    Blender/Python version changes.

- Compatibility data is updated:

  - On startup (when needed).
  - On an explicit "Refresh Local"
    (mainly for developers who may edit the manifest).
  - When refreshing extensions after install/uninstall etc.
    since an incompatible extensions may become compatible
    after an update.
  - When reloading preferences.

- Additional info is shown when the `--debug-python` is enabled,
  if there are ever issues with the extension compatibility cache
  generation not working as expected.

- The behavior for Python wheels has changed so they are only setup
  when the extension is enabled. This was done to simplify startup
  checks and has the benefit that an installed but disabled extension
  never runs code - as the ability to install wheels means it could
  have been imported from other scripts. It also means users can disable
  an extension to avoid wheel version conflicts.

  This does add the complication however that enabling add-on which is
  an extension must first ensure it's wheels are setup.
  See `addon_utils.extensions_refresh(..)`.

See code-comments for further details.
2024-07-01 15:08:14 +10:00
..
_bpy_internal Extensions: detect external changes on startup & loading preferences 2024-07-01 15:08:14 +10:00
bl_app_override Cleanup: Python script formatting 2024-06-06 11:26:28 +10:00
bl_console_utils Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
bl_i18n_utils I18n: Fix multi-context message extraction regex 2024-06-28 10:42:47 +02:00
bl_keymap_utils GPv3: Fill tool to generate strokes in empty areas 2024-05-15 13:36:06 +02:00
bl_previews_utils Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
bl_rna_utils Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
bl_text_utils Fix bl_text_utils/external_editor.py broken __all__ 2024-06-29 22:14:37 +10:00
bl_ui_utils Use the redirect.b.o website for bug reports 2024-04-30 14:56:33 +02:00
bpy Extensions: add a Python API for user editable extension directories 2024-06-26 14:23:17 +10:00
bpy_extras Extensions: move junction_module to a private location 2024-06-28 14:30:11 +10:00
gpu_extras License Headers: Set copyright to "Blender Authors", add AUTHORS 2023-08-16 00:20:26 +10:00
addon_utils.py Extensions: detect external changes on startup & loading preferences 2024-07-01 15:08:14 +10:00
animsys_refactor.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
bl_app_template_utils.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
blend_render_info.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
bpy_restrict_state.py License Headers: Set copyright to "Blender Authors", add AUTHORS 2023-08-16 00:20:26 +10:00
bpy_types.py PyAPI: fixes for defining operator macros 2024-06-01 16:17:02 +10:00
console_python.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
console_shell.py License Headers: Set copyright to "Blender Authors", add AUTHORS 2023-08-16 00:20:26 +10:00
graphviz_export.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
keyingsets_utils.py Fix #122372: Keyingsets not keying custom properties of type EnumProperty 2024-06-13 13:17:32 +02:00
nodeitems_utils.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
rna_info.py Cleanup: improve checks for function types for RNA introspection 2024-06-01 16:08:56 +10:00
rna_keymap_ui.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
rna_manual_reference.py Docs: Update rna manual references 2024-06-10 23:55:55 -04:00
rna_prop_ui.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00
rna_xml.py Core: support restricting the types an XML preset may load 2024-06-27 21:21:07 +10:00
sys_info.py Cleanup: replace %-formatting with str.format in scripts/modules/ 2024-04-27 16:06:51 +10:00