Bug 1304176 - Install psutil and mozsystemmonitor from source checkout; r?ted
Automation spends time downloading psutil and mozsystemmonitor from an
external host. These packages are vendored in the source repo.
This commit changes mozharness to use the vendored copy if available.
MozReview-Commit-ID: K6GtUiXf66M
--- a/testing/mozharness/mozharness/base/python.py
+++ b/testing/mozharness/mozharness/base/python.py
@@ -507,22 +507,28 @@ class ResourceMonitoringMixin(object):
While we would like to record resource usage for the entirety of a script,
since we require an external package, we can only record resource usage
after that package is installed (as part of creating the virtualenv).
That's just the way things have to be.
"""
def __init__(self, *args, **kwargs):
super(ResourceMonitoringMixin, self).__init__(*args, **kwargs)
- self.register_virtualenv_module('psutil>=3.1.1', method='pip',
+ if self.topsrcdir:
+ psutil = os.path.join(self.topsrcdir, 'python', 'psutil')
+ mozsystemmonitor = os.path.join(self.topsrcdir, 'testing',
+ 'mozbase', 'mozsystemmonitor')
+ else:
+ psutil = 'psutil>=3.1.1'
+ mozsystemmonitor = 'mozsystemmonitor==0.3'
+
+ self.register_virtualenv_module(psutil, method='pip', optional=True)
+ self.register_virtualenv_module(mozsystemmonitor, method='pip',
optional=True)
- self.register_virtualenv_module('mozsystemmonitor==0.3',
- method='pip', optional=True)
- self.register_virtualenv_module('jsonschema==2.5.1',
- method='pip')
+ self.register_virtualenv_module('jsonschema==2.5.1', method='pip')
# explicitly install functools32, because some slaves aren't using
# a version of pip recent enough to install it automatically with
# jsonschema (which depends on it)
# https://github.com/Julian/jsonschema/issues/233
self.register_virtualenv_module('functools32==3.2.3-2',
method='pip')
self._resource_monitor = None