Skip to content

Validate plugin python path on create when available#20

Open
MyPyDavid wants to merge 1 commit intoadd-config-app-for-plugin-modelfrom
codex/update-pluginpythonpathvalidator-availability-check
Open

Validate plugin python path on create when available#20
MyPyDavid wants to merge 1 commit intoadd-config-app-for-plugin-modelfrom
codex/update-pluginpythonpathvalidator-availability-check

Conversation

@MyPyDavid
Copy link
Owner

Motivation

  • Ensure the plugin python_path is importable at creation time when the incoming data marks the plugin as available via data.get('available', True).
  • Previously the import check only ran for updates when self.instance.available was true, allowing invalid import paths to be created.

Description

  • Update PluginPythonPathValidator.__call__ to determine availability from incoming data when instance is None and run the import check accordingly.
  • Keep the existing update behavior by only running the import check for updates when self.instance.available is true.
  • Use import_string and raise a validation error on ImportError or ModuleNotFoundError for invalid python_path values.
  • Preserve the existing checks that validate python_path against get_plugin_python_paths() and error messages.

Testing

  • No automated tests were run for this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant