summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGökçen Nurlu <gnurlu1@bloomberg.net>2018-01-11 17:38:11 +0000
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-01-16 16:33:58 +0900
commit6aaff4469b77804a460ca72e6511f18ce94c10ad (patch)
tree08f36984d6da98461c1bc882f58d0fa6825ab3e9
parentb340f995455b997995fc55277a993d5f5a1656e5 (diff)
downloadbuildstream-bst-1.0.tar.gz
Delay import of pkg_resourcesbst-1.0
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.
-rw-r--r--buildstream/_plugincontext.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/buildstream/_plugincontext.py b/buildstream/_plugincontext.py
index 410a4e718..0e1231e63 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,