pyblish stores paths in a registered paths variable. It doesn't add module paths to the sys path.
this results in plugins failing to load sometimes.
example:
We have the following files in a folder
my_plugin_folder:
-- __init__.py
-- pyblish_plugin.py
-- helper_functions.py
pyblish_plugin imports helper_functions
But my_plugin_folder is not in our sys path.
Loading pyblish_plugin will fail with module note found
possible solutions:
-
pyblish adds registered plugin paths to the system path.
To handle situations where 2 plugins both contain a file named helper_functions.py
we should always do import my_plugin_folder.helper_functions and not import helper_functions
-
discourage users from using import, and enforce that a plugin should be self contained.
this however severly limits plugins
-
ask user to handle environment management themselves correctly,
But this raises the entry bar for people who want to use pyblish.
Ideally an artist can download pyblish, download some plugins, load them in pyblish, and it all just works.
pyblish stores paths in a registered paths variable. It doesn't add module paths to the sys path.
this results in plugins failing to load sometimes.
example:
We have the following files in a folder
pyblish_plugin imports helper_functions
But my_plugin_folder is not in our sys path.
Loading pyblish_plugin will fail with module note found
possible solutions:
pyblish adds registered plugin paths to the system path.
To handle situations where 2 plugins both contain a file named helper_functions.py
we should always do
import my_plugin_folder.helper_functionsand notimport helper_functionsdiscourage users from using import, and enforce that a plugin should be self contained.
this however severly limits plugins
ask user to handle environment management themselves correctly,
But this raises the entry bar for people who want to use pyblish.
Ideally an artist can download pyblish, download some plugins, load them in pyblish, and it all just works.