InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

[Roadmap] Plugin Improvements

Open SchrodingersGat opened this issue 2 years ago • 6 comments

From issues identified in https://github.com/inventree/InvenTree/pull/5624

Plugin Features / Improvements

[tasklist]

Plugin Tasks

  • [x] Fix bug in "install plugin" API endpoint where failure is not correctly reported - https://github.com/inventree/InvenTree/pull/5646
  • [x] Automatically reload plugin registry when plugins change in another running worker - https://github.com/inventree/InvenTree/pull/5649
  • [x] Automatically run migrations when a new plugin is activated - https://github.com/inventree/InvenTree/pull/5668
  • [x] Improve plugin reload mechanism with mutex locking - https://github.com/inventree/InvenTree/pull/5649
  • [x] Enable plugin list API to be filtered by "builtin" or "sample" status - https://github.com/inventree/InvenTree/pull/5647
  • [x] Cleanup "old" plugin configs (which reference plugins which are no longer available on the system) - https://github.com/inventree/InvenTree/pull/5652
  • [x] Automatically reload plugin registry when the plugin settings change - https://github.com/inventree/InvenTree/pull/5662
  • [ ] Provide users with better feedback if a plugin requires features which are not enabled (like app-mixin / url-mixin / etc)
  • [x] Inform users when the system has unapplied migrations (if they are not applied automatically)
  • [ ] Collect more metadata for plugins which are not installed
  • [ ] Check for available plugin updates periodically - e.g. https://pypi.org/project/pip-check-updates/

SchrodingersGat avatar Oct 02 '23 22:10 SchrodingersGat

Not sure collection of more metadata is possible without running into serious security problems.

matmair avatar Oct 03 '23 08:10 matmair

Not sure collection of more metadata is possible without running into serious security problems.

It may not be. I'd like to look into it but it doesn't look likely

SchrodingersGat avatar Oct 03 '23 08:10 SchrodingersGat

Would be amazing if there were a way, I am just not aware of one.

matmair avatar Oct 03 '23 12:10 matmair

If there is no other way, the only thing I see is parsing the setup.py/plugin file without executing it, by converting it to an AST with pythons ast module.

wolflu05 avatar Oct 03 '23 13:10 wolflu05

If there is no other way, the only thing I see is parsing the setup.py/plugin file without executing it, by converting it to an AST with pythons ast module.

This is exactly how Blender does it for Python addons. Each addon has to contain a static bl_info section, like this for example, which can be parsed like that. The actual addon code will only be executed once you enable the addon.

30350n avatar Dec 16 '23 16:12 30350n

@30350n thanks for the info! And very nice looking plugin too. Might have to use that myself

SchrodingersGat avatar Dec 17 '23 05:12 SchrodingersGat