Add version-aware dependency validation and fix registration masking#65
Open
gyomh wants to merge 1 commit into
Open
Add version-aware dependency validation and fix registration masking#65gyomh wants to merge 1 commit into
gyomh wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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__.pynow catches any exception (not justModuleNotFoundError) during the operators/ui/keys import, and rolls backpip_importer's class registration on failure. Previously an unrelated exception (e.g.AttributeErrorfrom 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.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.