You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ariatosca.apache.org by mx...@apache.org on 2017/10/23 12:56:00 UTC

incubator-ariatosca git commit: ARIA-393 Enable configuration of extension loading mechanism strictness

Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-393-Enable-configuration-of-extension-loading-mechanism-strictness [created] 8a90e1fe5


ARIA-393 Enable configuration of extension loading mechanism strictness


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/8a90e1fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/8a90e1fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/8a90e1fe

Branch: refs/heads/ARIA-393-Enable-configuration-of-extension-loading-mechanism-strictness
Commit: 8a90e1fe5591ac9664f84f1bdd461d8d5642bdcb
Parents: 737fff5
Author: max-orlov <ma...@gigaspaces.com>
Authored: Mon Oct 23 15:55:46 2017 +0300
Committer: max-orlov <ma...@gigaspaces.com>
Committed: Mon Oct 23 15:55:46 2017 +0300

----------------------------------------------------------------------
 aria/__init__.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8a90e1fe/aria/__init__.py
----------------------------------------------------------------------
diff --git a/aria/__init__.py b/aria/__init__.py
index 76a62ce..f5e08f3 100644
--- a/aria/__init__.py
+++ b/aria/__init__.py
@@ -51,7 +51,7 @@ __all__ = (
 )
 
 
-def install_aria_extensions():
+def install_aria_extensions(strict=True):
     """
     Iterates all Python packages with names beginning with ``aria_extension_`` and all
     ``aria_extension`` entry points and loads them.
@@ -62,7 +62,13 @@ def install_aria_extensions():
         if module_name.startswith('aria_extension_'):
             loader.find_module(module_name).load_module(module_name)
     for entry_point in pkg_resources.iter_entry_points(group='aria_extension'):
-        entry_point.load()
+        # It should be possible to enable non strict loading - use the package
+        # that is already installed inside the environment, and forgo the
+        # version demand
+        if strict:
+            entry_point.load()
+        else:
+            entry_point.resolve()
     extension.init()