diff options
author | Gökçen Nurlu <gnurlu1@bloomberg.net> | 2018-01-11 17:38:11 +0000 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-01-16 16:33:58 +0900 |
commit | 6aaff4469b77804a460ca72e6511f18ce94c10ad (patch) | |
tree | 08f36984d6da98461c1bc882f58d0fa6825ab3e9 | |
parent | b340f995455b997995fc55277a993d5f5a1656e5 (diff) | |
download | buildstream-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.py | 2 |
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, |