diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-12-04 19:06:53 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-12-04 19:07:36 +0100 |
commit | 6b0f1e8ac1ef5e1e37c74eddedc09b848ae031cd (patch) | |
tree | e115d4c022eefae68072516a675caf3be4b5ea07 /scripts/dev/recompile_requirements.py | |
parent | cad3394e9bf34fb6f3d45782a882a1019b5b843b (diff) | |
download | qutebrowser-6b0f1e8ac1ef5e1e37c74eddedc09b848ae031cd.tar.gz qutebrowser-6b0f1e8ac1ef5e1e37c74eddedc09b848ae031cd.zip |
scripts: Make recompile_requirements less verbose
Diffstat (limited to 'scripts/dev/recompile_requirements.py')
-rw-r--r-- | scripts/dev/recompile_requirements.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/dev/recompile_requirements.py b/scripts/dev/recompile_requirements.py index 72eeec083..4caa26667 100644 --- a/scripts/dev/recompile_requirements.py +++ b/scripts/dev/recompile_requirements.py @@ -261,13 +261,17 @@ def get_all_names(): yield basename[len('requirements-'):-len('.txt-raw')] -def run_pip(venv_dir, *args, **kwargs): +def run_pip(venv_dir, *args, quiet=False, **kwargs): """Run pip inside the virtualenv.""" + args = list(args) + if quiet: + args.insert(1, '-q') + arg_str = ' '.join(str(arg) for arg in args) utils.print_col('venv$ pip {}'.format(arg_str), 'blue') + venv_python = os.path.join(venv_dir, 'bin', 'python') - return subprocess.run([venv_python, '-m', 'pip'] + list(args), - check=True, **kwargs) + return subprocess.run([venv_python, '-m', 'pip'] + args, check=True, **kwargs) def init_venv(host_python, venv_dir, requirements, pre=False): @@ -276,8 +280,8 @@ def init_venv(host_python, venv_dir, requirements, pre=False): utils.print_col('$ python3 -m venv {}'.format(venv_dir), 'blue') subprocess.run([host_python, '-m', 'venv', venv_dir], check=True) - run_pip(venv_dir, 'install', '-U', 'pip') - run_pip(venv_dir, 'install', '-U', 'setuptools', 'wheel') + run_pip(venv_dir, 'install', '-U', 'pip', quiet=not utils.ON_CI) + run_pip(venv_dir, 'install', '-U', 'setuptools', 'wheel', quiet=not utils.ON_CI) install_command = ['install', '-r', requirements] if pre: |