Skip to content

Add version-aware dependency validation and fix registration masking#65

Open
gyomh wants to merge 1 commit into
maybites:masterfrom
gyomh:fix/version-aware-deps
Open

Add version-aware dependency validation and fix registration masking#65
gyomh wants to merge 1 commit into
maybites:masterfrom
gyomh:fix/version-aware-deps

Conversation

@gyomh

@gyomh gyomh commented Jul 8, 2026

Copy link
Copy Markdown

Fixes the issues raised in #64 — thanks for confirming the diagnosis and root cause of the masking bug.

  • check_module() / store_package_show() now compare the installed version against the package's required version spec (_version_satisfies) instead of treating any importable module as satisfying the requirement. This applies to SpoutGL, syphon-python, and cyndilib since they all share the same helper.
  • register() in __init__.py now catches any exception (not just ModuleNotFoundError) during the operators/ui/keys import, and rolls back pip_importer's class registration on failure. Previously an unrelated exception (e.g. AttributeError from a stale dependency) would escape uncaught, leaving those classes registered, so the next enable attempt failed on "already registered as a subclass" instead of showing the real error.
  • The preferences panel now shows "Outdated (installed -> required)" instead of the generic "Not installed" label when a stale version is detected.

Tested locally on Windows / Blender 5.0 by downgrading SpoutGL to 0.0.6 and confirming: the panel correctly shows "Outdated", the real underlying error is printed instead of the masked registration error, and re-enabling after fixing the version works cleanly.

check_module()/store_package_show() previously marked any importable
module as satisfying its requirement regardless of installed version,
so a stale SpoutGL/syphon-python/cyndilib install was silently
reported as fine. Add version comparison (_version_satisfies) shared
by both detection paths so outdated installs are correctly rejected.

If a dependency then raised anything other than ModuleNotFoundError
during startup (e.g. AttributeError from a missing method on an old
version), the exception escaped uncaught after pip_importer's classes
were already registered. Blender disabled the addon but left those
classes registered, so the next enable attempt failed on
"already registered as a subclass" instead of showing the real error.
Catch the broader exception and roll back pip_importer's registration
so the actual failure is reported.

Also surface "Outdated (installed -> required)" in the preferences
panel instead of the generic "Not installed" label when a stale
version is detected, using the version captured by the checks above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant