Ensures that the packages installed in a local virtualenv is taken
before the propagation of the global Meshroom environment to avoid
version conflicts.
Note: We tried to avoid checking files/folders on disk at startup for
performance reasons, but here we are forced to use glob as there is no
way to know the python version of the plugin in advance.
The command's prefix and suffix are correctly set, but Meshroom still
needs to be injected to the list of rez packages in order to be available
in the `PYTHONPATH`.
If the plugin has successfully been reloaded, return `True`. If it has
not been reloaded for any reason (either an error or because no
modification has been made to it since it has been loaded last), then
return `False`.
Remove the methods and perform the registration/unregistration directly
within the functions that called them. This simplifies the code and
prevents ambiguity between the different functions.
When calling the `reload()` method for `NodePlugins`, we now check that
the timestamp of the node's description file doesn't match with the
timestamp of that same file when the `NodePlugin` was created. If it
does match, then nothing happens during the `reload()`.
Additionnally, add a new error status to distinguish an error during
the registration of the plugin (`LOADING_ERROR`) and an error when
the module itself is reloaded (through the `reload` function from
importlib).
A `NodePlugin` may be part of a `Plugin` even if it has not been
registered. `containsNode` allows to check whether a `NodePlugin` is
contained within a `Plugin`, and `belongsToPlugin`
This prevents ambiguities between `NodePlugin` objects that have been
registered (and are thus instantiable) and those that belong to `Plugin`
objects but have not been registered.
The validation of the node descriptions will be handled directly within
the `NodePlugin` objects and there is thus no need for this method to
exist outside of plugins.py.
A `Plugin` object contains a collection of nodes, represented as
`NodePlugin` objects. This commit adds the implementation of the `Plugin`
class with the methods to add and remove `NodePlugins`, as well as an
empty class for the `NodePlugin` objects themselves.
Add a new module named `plugins` with a `ProcessEnv` class which
contains the paths describing the environment needed for the plugin's
(node's) process.