You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUG#29928485 PYTHON PLUGINS: FAILS LOADING PLUGINS HAVING INNER PACKAGE WITH THE SAME NAME
This bug describes an unexpected behavior when two plugins contain an inner package with
the same name, it results in the second plugin not being loaded because the definitions
on the affected package are not available.
This is due to a name clashing on package names caused because the plugin logic adds both
the plugin path (and in the case of plugin groups, the parent plugin path) into sys path,
allowing the inner packages to be imported using import <package_name>.
This patch fixes this problem by replacing the paths to the plugin/plugin group with the
plugins folder from which the plugins are being loaded. As a consecuense the following
restrictions are added when defining plugins with inner packages or shared code:
- The main plugin folder must be a valid package name according to python standards (PEP-8)
- Each folder to be considered a package must contain a file named __init__.py
The imports will have to be done with fully specified package names, i.e.
from <plugin_name>[.<package_name>]* import <target_import>
This resolves the package name clashing and so the reported bug.
Change-Id: I9bcc29a237839556d2a03527fe23c657250c30c1
0 commit comments