This is an automated email from the ASF dual-hosted git repository. github-bot pushed a commit to branch bst-1.0 in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 6aaff4469b77804a460ca72e6511f18ce94c10ad Author: Gökçen Nurlu <[email protected]> AuthorDate: Thu Jan 11 17:38:11 2018 +0000 Delay import of pkg_resources This does not introduce a performance gain alone, but importing pkg_resources is costly at the moment and can be avoided until it is actually needed. --- buildstream/_plugincontext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildstream/_plugincontext.py b/buildstream/_plugincontext.py index 410a4e7..0e1231e 100644 --- a/buildstream/_plugincontext.py +++ b/buildstream/_plugincontext.py @@ -20,7 +20,6 @@ import os import inspect -import pkg_resources from ._exceptions import PluginError from . import utils @@ -84,6 +83,7 @@ class PluginContext(): def _get_pip_plugin_source(self, package_name, kind): defaults = None if ('pip', package_name) not in self.alternate_sources: + import pkg_resources # key by a tuple to avoid collision try: package = pkg_resources.get_entry_info(package_name,
