Repository: incubator-ariatosca
Updated Branches:
  refs/heads/new_wagon_setuptools cf23ee8b3 -> 92c60230b (forced update)


wip


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

Branch: refs/heads/new_wagon_setuptools
Commit: 92c60230bc75d169926614ab7bed10cf6d845b89
Parents: 71c4e4c
Author: max-orlov <[email protected]>
Authored: Thu Oct 19 12:37:08 2017 +0300
Committer: max-orlov <[email protected]>
Committed: Thu Oct 19 14:28:57 2017 +0300

----------------------------------------------------------------------
 aria/__init__.py | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/92c60230/aria/__init__.py
----------------------------------------------------------------------
diff --git a/aria/__init__.py b/aria/__init__.py
index 76a62ce..633c5c8 100644
--- a/aria/__init__.py
+++ b/aria/__init__.py
@@ -18,11 +18,43 @@ The ARIA root package provides entry points for extension 
and storage initializa
 """
 
 import sys
+import types
 
+import os
 import pkg_resources
 aria_package_name = 'apache-ariatosca'
 __version__ = pkg_resources.get_distribution(aria_package_name).version
 
+
+
+
+try:
+    import ruamel                                           # noqa: F401
+except ImportError:
+    if sys.version_info[0] > 2:
+        raise
+
+    # Traverse all of the site-packages and try to load ruamel.
+    for packages_dir in sys.path:
+        ruamel_path = os.path.join(packages_dir, 'ruamel')
+        if not os.path.exists(ruamel_path):
+            continue
+
+        # If the top dir has an __init__.py file, the loading should have
+        # succeeded automatically
+        if os.path.exists(os.path.join(ruamel_path, '__init__.py')):
+            raise
+
+        # Dynamically create mapping to the ruamel package
+        ruamel_module = sys.modules.setdefault(
+            'ruamel',
+            types.ModuleType('ruamel')
+        )
+        # add path to the mapped package
+        ruamel_module.__dict__.setdefault('__path__', []).append(ruamel_path)
+
+
+
 from .orchestrator.decorators import workflow, operation  # pylint: 
disable=wrong-import-position
 from . import (  # pylint: disable=wrong-import-position
     extension,
@@ -62,7 +94,7 @@ 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()
+        entry_point.resolve()
     extension.init()
 
 

Reply via email to