Bug 1410424 - [mozbuild] Add a 'quiet' argument to VirtualenvManager.install_pip_requirements draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Fri, 06 Apr 2018 10:23:49 -0400
changeset 783610 be49359d01dd917615ec25d0062b4fb1eeacb599
parent 783549 f94b64e0020225c71701930f193bd96c3ad1d150
child 783611 32e4efadc348e81942c58be97d590ced44ae4b23
child 783640 76437a58b4c919c953fcb7680fb126585fe94795
push id106733
push userahalberstadt@mozilla.com
push dateTue, 17 Apr 2018 14:02:10 +0000
bugs1410424
milestone61.0a1
Bug 1410424 - [mozbuild] Add a 'quiet' argument to VirtualenvManager.install_pip_requirements Some requirements.txt are very large and result in a lot of package already installed messages. Would be nice to hide this. MozReview-Commit-ID: FQecuePM0zZ
python/mozbuild/mozbuild/virtualenv.py
tools/docs/mach_commands.py
--- a/python/mozbuild/mozbuild/virtualenv.py
+++ b/python/mozbuild/mozbuild/virtualenv.py
@@ -483,17 +483,17 @@ class VirtualenvManager(object):
         args = [
             'install',
             '--use-wheel',
             package,
         ]
 
         return self._run_pip(args)
 
-    def install_pip_requirements(self, path, require_hashes=True):
+    def install_pip_requirements(self, path, require_hashes=True, quiet=False):
         """Install a pip requirements.txt file.
 
         The supplied path is a text file containing pip requirement
         specifiers.
 
         If require_hashes is True, each specifier must contain the
         expected hash of the downloaded package. See:
         https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode
@@ -506,16 +506,19 @@ class VirtualenvManager(object):
             'install',
             '--requirement',
             path,
         ]
 
         if require_hashes:
             args.append('--require-hashes')
 
+        if quiet:
+            args.append('--quiet')
+
         return self._run_pip(args)
 
     def _run_pip(self, args):
         # It's tempting to call pip natively via pip.main(). However,
         # the current Python interpreter may not be the virtualenv python.
         # This will confuse pip and cause the package to attempt to install
         # against the executing interpreter. By creating a new process, we
         # force the virtualenv's interpreter to be used and all is well.
--- a/tools/docs/mach_commands.py
+++ b/tools/docs/mach_commands.py
@@ -46,17 +46,18 @@ class Documentation(MachCommandBase):
     def build_docs(self, what=None, format=None, outdir=None, auto_open=True,
                    http=None, archive=False, upload=False):
         try:
             which.which('jsdoc')
         except which.WhichError:
             return die('jsdoc not found - please install from npm.')
 
         self._activate_virtualenv()
-        self.virtualenv_manager.install_pip_requirements(os.path.join(here, 'requirements.txt'))
+        self.virtualenv_manager.install_pip_requirements(
+            os.path.join(here, 'requirements.txt'), quiet=True)
 
         import sphinx
         import webbrowser
         import moztreedocs
 
         if not outdir:
             outdir = os.path.join(self.topobjdir, 'docs')
         if not what: