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
--- 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: