From b620d7921e063d2c4f527389f560064df7358103 Mon Sep 17 00:00:00 2001 From: Kenneth Daily Date: Mon, 13 Jan 2025 14:23:00 -0800 Subject: [PATCH] Run ruff format --- scripts/gen-ac-index | 22 +++-- scripts/gen-server-completions | 7 +- scripts/install | 114 ++++++++++++++----------- scripts/install_deps.py | 11 ++- scripts/make-bundle | 55 +++++++----- scripts/make-global-opts-documentation | 6 +- scripts/new-change | 57 ++++++++----- scripts/performance/benchmark_utils.py | 73 +++++++++++----- scripts/regenerate-lock-files | 28 ++++-- scripts/utils.py | 6 +- 10 files changed, 239 insertions(+), 140 deletions(-) diff --git a/scripts/gen-ac-index b/scripts/gen-ac-index index a4c16c1bc657..31feff335919 100755 --- a/scripts/gen-ac-index +++ b/scripts/gen-ac-index @@ -1,7 +1,6 @@ #!/usr/bin/env python -"""Generate the index used for the new auto-completion. +"""Generate the index used for the new auto-completion.""" -""" import os import argparse @@ -11,13 +10,18 @@ from awscli.autocomplete import generator def main(): parser = argparse.ArgumentParser() - parser.add_argument('--include-builtin-index', action='store_true', - help=("Also generate builtin index as well as the " - "INDEX_LOCATION.")) - parser.add_argument('--index-location', default=db.INDEX_FILE, - help=( - 'Location to write the index file. ' - 'Defaults to ' + db.INDEX_FILE)) + parser.add_argument( + '--include-builtin-index', + action='store_true', + help=("Also generate builtin index as well as the " "INDEX_LOCATION."), + ) + parser.add_argument( + '--index-location', + default=db.INDEX_FILE, + help=( + 'Location to write the index file. ' 'Defaults to ' + db.INDEX_FILE + ), + ) args = parser.parse_args() index_dir = os.path.dirname(os.path.abspath(args.index_location)) if not os.path.isdir(index_dir): diff --git a/scripts/gen-server-completions b/scripts/gen-server-completions index 335e685cec75..a06dc072fc87 100755 --- a/scripts/gen-server-completions +++ b/scripts/gen-server-completions @@ -13,6 +13,7 @@ if you want to see the generated completion data without modifying existing files. """ + import argparse import json import sys @@ -37,8 +38,10 @@ def generate_completion_data(args): model = session.get_service_model(service_name) completion_data = gen.generate_completion_descriptions(model) out_filename = os.path.join( - BOTOCORE_DATA_PATH, service_name, - model.api_version, 'completions-1.json' + BOTOCORE_DATA_PATH, + service_name, + model.api_version, + 'completions-1.json', ) to_json = _pretty_json_dump(completion_data) if args.only_print: diff --git a/scripts/install b/scripts/install index 8f825eb62ac7..e4835fa63792 100755 --- a/scripts/install +++ b/scripts/install @@ -17,15 +17,15 @@ import tempfile from contextlib import contextmanager PACKAGES_DIR = os.path.join( - os.path.dirname(os.path.abspath(__file__)), 'packages') -INSTALL_DIR = os.path.expanduser(os.path.join( - '~', '.local', 'lib', 'aws')) + os.path.dirname(os.path.abspath(__file__)), 'packages' +) +INSTALL_DIR = os.path.expanduser(os.path.join('~', '.local', 'lib', 'aws')) GTE_PY37 = sys.version_info[:2] >= (3, 7) UNSUPPORTED_PYTHON = ( - (2,6), - (3,3), - (3,4), - (3,5), + (2, 6), + (3, 3), + (3, 4), + (3, 5), ) INSTALL_ARGS = ( '--no-binary :all: --no-build-isolation --no-cache-dir --no-index ' @@ -45,6 +45,7 @@ class PythonDeprecationWarning(Warning): Python version being used is scheduled to become unsupported in an future release. See warning for specifics. """ + pass @@ -52,12 +53,10 @@ def _build_deprecations(): py_27_params = { 'date': 'July 15, 2021', 'blog_link': 'https://aws.amazon.com/blogs/developer/announcing-end-' - 'of-support-for-python-2-7-in-aws-sdk-for-python-and-' - 'aws-cli-v1/' - } - return { - (2,7): py_27_params + 'of-support-for-python-2-7-in-aws-sdk-for-python-and-' + 'aws-cli-v1/', } + return {(2, 7): py_27_params} DEPRECATED_PYTHON = _build_deprecations() @@ -75,13 +74,15 @@ def cd(dirname): def run(cmd): sys.stdout.write("Running cmd: %s\n" % cmd) - p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) stdout, stderr = p.communicate() if p.returncode != 0: output = (stdout + stderr).decode("utf-8") - raise BadRCError("Bad rc (%s) for cmd '%s': %s" % ( - p.returncode, cmd, output)) + raise BadRCError( + "Bad rc (%s) for cmd '%s': %s" % (p.returncode, cmd, output) + ) return stdout @@ -123,15 +124,16 @@ def _create_virtualenv_external(location, working_dir): # We know that virtualenv is the only dir in this directory # so we can listdir()[0] it. with cd(os.listdir('.')[0]): - run(('%s virtualenv.py --no-download ' - '--python %s %s') % (sys.executable, - sys.executable, - location)) + run( + ('%s virtualenv.py --no-download ' '--python %s %s') + % (sys.executable, sys.executable, location) + ) def _get_package_tarball(package_dir, package_prefix): - package_filenames = sorted([p for p in os.listdir(package_dir) - if p.startswith(package_prefix)]) + package_filenames = sorted( + [p for p in os.listdir(package_dir) if p.startswith(package_prefix)] + ) return package_filenames[-1] @@ -145,8 +147,9 @@ def create_working_dir(): def pip_install_packages(install_dir): - cli_tarball = [p for p in os.listdir(PACKAGES_DIR) - if p.startswith('awscli')] + cli_tarball = [ + p for p in os.listdir(PACKAGES_DIR) if p.startswith('awscli') + ] if len(cli_tarball) != 1: message = ( "Multiple versions of the CLI were found in %s. Please clear " @@ -161,8 +164,10 @@ def pip_install_packages(install_dir): _install_setup_deps(pip_script, '.') with cd(PACKAGES_DIR): - run('%s install %s --find-links file://%s %s' % ( - pip_script, INSTALL_ARGS, PACKAGES_DIR, cli_tarball)) + run( + '%s install %s --find-links file://%s %s' + % (pip_script, INSTALL_ARGS, PACKAGES_DIR, cli_tarball) + ) def _install_setup_deps(pip_script, setup_package_dir): @@ -172,15 +177,19 @@ def _install_setup_deps(pip_script, setup_package_dir): # so for now we're explicitly installing the one setup_requires package # we need. This comes from python-dateutils. setuptools_scm_tarball = _get_package_tarball( - setup_package_dir, 'setuptools_scm') - run('%s install --no-binary :all: --no-cache-dir --no-index ' - '--find-links file://%s %s' % ( - pip_script, setup_package_dir, setuptools_scm_tarball)) - wheel_tarball = _get_package_tarball( - setup_package_dir, 'wheel') - run('%s install --no-binary :all: --no-cache-dir --no-index ' - '--find-links file://%s %s' % ( - pip_script, setup_package_dir, wheel_tarball)) + setup_package_dir, 'setuptools_scm' + ) + run( + '%s install --no-binary :all: --no-cache-dir --no-index ' + '--find-links file://%s %s' + % (pip_script, setup_package_dir, setuptools_scm_tarball) + ) + wheel_tarball = _get_package_tarball(setup_package_dir, 'wheel') + run( + '%s install --no-binary :all: --no-cache-dir --no-index ' + '--find-links file://%s %s' + % (pip_script, setup_package_dir, wheel_tarball) + ) def create_symlink(real_location, symlink_name): @@ -197,17 +206,25 @@ def create_symlink(real_location, symlink_name): def main(): parser = optparse.OptionParser() - parser.add_option('-i', '--install-dir', help="The location to install " - "the AWS CLI. The default value is ~/.local/lib/aws", - default=INSTALL_DIR) - parser.add_option('-b', '--bin-location', help="If this argument is " - "provided, then a symlink will be created at this " - "location that points to the aws executable. " - "This argument is useful if you want to put the aws " - "executable somewhere already on your path, e.g. " - "-b /usr/local/bin/aws. This is an optional argument. " - "If you do not provide this argument you will have to " - "add INSTALL_DIR/bin to your PATH.") + parser.add_option( + '-i', + '--install-dir', + help="The location to install " + "the AWS CLI. The default value is ~/.local/lib/aws", + default=INSTALL_DIR, + ) + parser.add_option( + '-b', + '--bin-location', + help="If this argument is " + "provided, then a symlink will be created at this " + "location that points to the aws executable. " + "This argument is useful if you want to put the aws " + "executable somewhere already on your path, e.g. " + "-b /usr/local/bin/aws. This is an optional argument. " + "If you do not provide this argument you will have to " + "add INSTALL_DIR/bin to your PATH.", + ) py_version = sys.version_info[:2] if py_version in UNSUPPORTED_PYTHON: unsupported_python_msg = ( @@ -240,8 +257,9 @@ def main(): create_install_structure(working_dir, opts.install_dir) pip_install_packages(opts.install_dir) real_location = os.path.join(opts.install_dir, bin_path(), 'aws') - if opts.bin_location and create_symlink(real_location, - opts.bin_location): + if opts.bin_location and create_symlink( + real_location, opts.bin_location + ): print("You can now run: %s --version" % opts.bin_location) else: print("You can now run: %s --version" % real_location) diff --git a/scripts/install_deps.py b/scripts/install_deps.py index 39db22085a35..ab58e6ea8bb2 100644 --- a/scripts/install_deps.py +++ b/scripts/install_deps.py @@ -2,7 +2,9 @@ from utils import cd, bin_path, run, virtualenv_enabled -INSTALL_ARGS = "--no-build-isolation --no-cache-dir --no-index --prefer-binary " +INSTALL_ARGS = ( + "--no-build-isolation --no-cache-dir --no-index --prefer-binary " +) PINNED_PIP_VERSION = '24.0' SETUP_DEPS = ("setuptools-", "setuptools_scm", "wheel", "hatchling") @@ -17,7 +19,8 @@ def get_package_tarball(package_dir, package_prefix): ) if len(package_filenames) == 0: raise InstallationError( - "Unable to find local package starting with %s prefix." % package_prefix + "Unable to find local package starting with %s prefix." + % package_prefix ) # We only expect a single package from the downloader return package_filenames[0] @@ -41,7 +44,9 @@ def pip_install_packages(package_dir): # Setup pip to support modern setuptools calls pip_script = os.path.join(os.environ["VIRTUAL_ENV"], bin_path(), "pip") - local_python = os.path.join(os.environ["VIRTUAL_ENV"], bin_path(), "python") + local_python = os.path.join( + os.environ["VIRTUAL_ENV"], bin_path(), "python" + ) # Windows can't replace a running pip.exe, so we need to work around run("%s -m pip install pip==%s" % (local_python, PINNED_PIP_VERSION)) diff --git a/scripts/make-bundle b/scripts/make-bundle index 915e4dea0255..8e2736289106 100755 --- a/scripts/make-bundle +++ b/scripts/make-bundle @@ -12,6 +12,7 @@ interface for those not familiar with the python ecosystem. """ + import os import sys import subprocess @@ -36,7 +37,8 @@ PIP_DOWNLOAD_ARGS = '--no-binary :all:' # we're distributing a copy that works on all supported platforms. CONSTRAINTS_FILE = os.path.join( os.path.dirname(os.path.abspath(__file__)), - 'assets', 'constraints-bundled.txt' + 'assets', + 'constraints-bundled.txt', ) @@ -56,13 +58,15 @@ def cd(dirname): def run(cmd): sys.stdout.write("Running cmd: %s\n" % cmd) - p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) stdout, stderr = p.communicate() rc = p.wait() if p.returncode != 0: - raise BadRCError("Bad rc (%s) for cmd '%s': %s" % ( - rc, cmd, stderr + stdout)) + raise BadRCError( + "Bad rc (%s) for cmd '%s': %s" % (rc, cmd, stderr + stdout) + ) return stdout @@ -80,17 +84,19 @@ def create_scratch_dir(): def download_package_tarballs(dirname, packages): with cd(dirname): for package, package_version in packages: - run('%s -m pip download %s==%s %s' % ( - sys.executable, package, package_version, PIP_DOWNLOAD_ARGS - )) + run( + '%s -m pip download %s==%s %s' + % (sys.executable, package, package_version, PIP_DOWNLOAD_ARGS) + ) def download_cli_deps(scratch_dir): - awscli_dir = os.path.dirname( - os.path.dirname(os.path.abspath(__file__))) + awscli_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) with cd(scratch_dir): - run('pip download -c %s %s %s' % ( - CONSTRAINTS_FILE, PIP_DOWNLOAD_ARGS, awscli_dir)) + run( + 'pip download -c %s %s %s' + % (CONSTRAINTS_FILE, PIP_DOWNLOAD_ARGS, awscli_dir) + ) def _remove_cli_zip(scratch_dir): @@ -100,20 +106,21 @@ def _remove_cli_zip(scratch_dir): def add_cli_sdist(scratch_dir): - awscli_dir = os.path.dirname( - os.path.dirname(os.path.abspath(__file__))) + awscli_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if os.path.exists(os.path.join(awscli_dir, 'dist')): shutil.rmtree(os.path.join(awscli_dir, 'dist')) with cd(awscli_dir): run('%s setup.py sdist' % sys.executable) filename = os.listdir('dist')[0] - shutil.move(os.path.join('dist', filename), - os.path.join(scratch_dir, filename)) + shutil.move( + os.path.join('dist', filename), os.path.join(scratch_dir, filename) + ) def create_bootstrap_script(scratch_dir): install_script = os.path.join( - os.path.dirname(os.path.abspath(__file__)), 'install') + os.path.dirname(os.path.abspath(__file__)), 'install' + ) shutil.copy(install_script, os.path.join(scratch_dir, 'install')) @@ -135,11 +142,13 @@ def zip_dir(scratch_dir): def verify_preconditions(): # The pip version looks like: # 'pip 1.4.1 from ....' - pip_version = run( - '%s -m pip --version' % sys.executable).strip().split()[1] + pip_version = ( + run('%s -m pip --version' % sys.executable).strip().split()[1] + ) # Virtualenv version just has the version string: '1.14.5\n' virtualenv_version = run( - '%s -m virtualenv --version' % sys.executable).strip() + '%s -m virtualenv --version' % sys.executable + ).strip() _min_version_required('9.0.1', pip_version, 'pip') _min_version_required('15.1.0', virtualenv_version, 'virtualenv') @@ -152,8 +161,10 @@ def _min_version_required(min_version, actual_version, name): for min_version_part, actual_version_part in zip(min_split, actual_split): if int(actual_version_part) >= int(min_version_part): return - raise ValueError("%s requires at least version %s, but version %s was " - "found." % (name, min_version, actual_version)) + raise ValueError( + "%s requires at least version %s, but version %s was " + "found." % (name, min_version, actual_version) + ) def main(): diff --git a/scripts/make-global-opts-documentation b/scripts/make-global-opts-documentation index 3f8f345df62c..7150f0d7d97f 100755 --- a/scripts/make-global-opts-documentation +++ b/scripts/make-global-opts-documentation @@ -12,8 +12,10 @@ import os from awscli.clidriver import create_clidriver from awscli.clidocs import ( - EXAMPLES_DIR, GLOBAL_OPTIONS_FILE, - GLOBAL_OPTIONS_SYNOPSIS_FILE, GlobalOptionsDocumenter + EXAMPLES_DIR, + GLOBAL_OPTIONS_FILE, + GLOBAL_OPTIONS_SYNOPSIS_FILE, + GlobalOptionsDocumenter, ) diff --git a/scripts/new-change b/scripts/new-change index 8b4905147318..4f1e1bccf1cd 100755 --- a/scripts/new-change +++ b/scripts/new-change @@ -36,6 +36,7 @@ You can then use the ``scripts/render-change`` to generate the CHANGELOG.rst file. """ + import os import re import sys @@ -49,8 +50,7 @@ import argparse VALID_CHARS = set(string.ascii_letters + string.digits) CHANGES_DIR = os.path.join( - os.path.dirname(os.path.dirname(os.path.abspath(__file__))), - '.changes' + os.path.dirname(os.path.dirname(os.path.abspath(__file__))), '.changes' ) TEMPLATE = """\ # Type should be one of: feature, bugfix, enhancement, api-change @@ -90,7 +90,8 @@ def new_changelog_entry(args): parsed_values = get_values_from_editor(args) if has_empty_values(parsed_values): sys.stderr.write( - "Empty changelog values received, skipping entry creation.\n") + "Empty changelog values received, skipping entry creation.\n" + ) return 1 replace_issue_references(parsed_values, args.repo) write_new_change(parsed_values) @@ -98,9 +99,11 @@ def new_changelog_entry(args): def has_empty_values(parsed_values): - return not (parsed_values.get('type') and - parsed_values.get('category') and - parsed_values.get('description')) + return not ( + parsed_values.get('type') + and parsed_values.get('category') + and parsed_values.get('description') + ) def all_values_provided(args): @@ -131,9 +134,11 @@ def replace_issue_references(parsed, repo_name): def linkify(match): number = match.group()[1:] - return ( - '`%s `__' % ( - match.group(), repo_name, number)) + return '`%s `__' % ( + match.group(), + repo_name, + number, + ) new_description = re.sub('#\d+', linkify, description) parsed['description'] = new_description @@ -151,13 +156,15 @@ def write_new_change(parsed_values): category = parsed_values['category'] short_summary = ''.join(filter(lambda x: x in VALID_CHARS, category)) filename = '{type_name}-{summary}'.format( - type_name=parsed_values['type'], - summary=short_summary) + type_name=parsed_values['type'], summary=short_summary + ) possible_filename = os.path.join( - dirname, '%s-%s.json' % (filename, str(random.randint(1, 100000)))) + dirname, '%s-%s.json' % (filename, str(random.randint(1, 100000))) + ) while os.path.isfile(possible_filename): possible_filename = os.path.join( - dirname, '%s-%s.json' % (filename, str(random.randint(1, 100000)))) + dirname, '%s-%s.json' % (filename, str(random.randint(1, 100000))) + ) with open(possible_filename, 'w') as f: f.write(json.dumps(parsed_values, indent=2) + "\n") @@ -198,15 +205,21 @@ def parse_filled_in_contents(contents): def main(): parser = argparse.ArgumentParser() - parser.add_argument('-t', '--type', dest='change_type', - default='', choices=('bugfix', 'feature', - 'enhancement', 'api-change')) - parser.add_argument('-c', '--category', dest='category', - default='') - parser.add_argument('-d', '--description', dest='description', - default='') - parser.add_argument('-r', '--repo', default='aws/aws-cli', - help='Optional repo name, e.g: aws/aws-cli') + parser.add_argument( + '-t', + '--type', + dest='change_type', + default='', + choices=('bugfix', 'feature', 'enhancement', 'api-change'), + ) + parser.add_argument('-c', '--category', dest='category', default='') + parser.add_argument('-d', '--description', dest='description', default='') + parser.add_argument( + '-r', + '--repo', + default='aws/aws-cli', + help='Optional repo name, e.g: aws/aws-cli', + ) args = parser.parse_args() sys.exit(new_changelog_entry(args)) diff --git a/scripts/performance/benchmark_utils.py b/scripts/performance/benchmark_utils.py index da48ae372d81..fd9e1e1724e9 100644 --- a/scripts/performance/benchmark_utils.py +++ b/scripts/performance/benchmark_utils.py @@ -145,9 +145,16 @@ def get_transfer_command(command, recursive, quiet): return cli_command -def benchmark_command(command, benchmark_script, summarize_script, - output_dir, num_iterations, dry_run, upkeep=None, - cleanup=None): +def benchmark_command( + command, + benchmark_script, + summarize_script, + output_dir, + num_iterations, + dry_run, + upkeep=None, + cleanup=None, +): """Benchmark several runs of a long-running command. :type command: str @@ -192,7 +199,10 @@ def benchmark_command(command, benchmark_script, summarize_script, out_file = 'performance%s.csv' % i out_file = os.path.join(performance_dir, out_file) benchmark_args = [ - benchmark_script, command, '--output-file', out_file + benchmark_script, + command, + '--output-file', + out_file, ] if not dry_run: subprocess.check_call(benchmark_args) @@ -210,42 +220,61 @@ def get_default_argparser(): """Get an ArgumentParser with all the base benchmark arguments added in.""" parser = argparse.ArgumentParser() parser.add_argument( - '--no-cleanup', action='store_true', default=False, - help='Do not remove the destination after the tests complete.' + '--no-cleanup', + action='store_true', + default=False, + help='Do not remove the destination after the tests complete.', ) parser.add_argument( - '--recursive', action='store_true', default=False, - help='Indicates that this is a recursive transfer.' + '--recursive', + action='store_true', + default=False, + help='Indicates that this is a recursive transfer.', ) benchmark_script = get_benchmark_script() parser.add_argument( - '--benchmark-script', default=benchmark_script, + '--benchmark-script', + default=benchmark_script, required=benchmark_script is None, - help=('The benchmark script to run the commands with. This should be ' - 'from s3transfer.') + help=( + 'The benchmark script to run the commands with. This should be ' + 'from s3transfer.' + ), ) summarize_script = get_summarize_script() parser.add_argument( - '--summarize-script', default=summarize_script, + '--summarize-script', + default=summarize_script, required=summarize_script is None, - help=('The summarize script to run the commands with. This should be ' - 'from s3transfer.') + help=( + 'The summarize script to run the commands with. This should be ' + 'from s3transfer.' + ), ) parser.add_argument( - '-o', '--result-dir', default='results', + '-o', + '--result-dir', + default='results', help='The directory to output performance results to. Existing ' - 'results will be deleted.' + 'results will be deleted.', ) parser.add_argument( - '--dry-run', default=False, action='store_true', - help='If set, commands will only be printed out, not executed.' + '--dry-run', + default=False, + action='store_true', + help='If set, commands will only be printed out, not executed.', ) parser.add_argument( - '--quiet', default=False, action='store_true', - help='If set, output is suppressed.' + '--quiet', + default=False, + action='store_true', + help='If set, output is suppressed.', ) parser.add_argument( - '-n', '--num-iterations', default=1, type=int, - help='The number of times to run the test.' + '-n', + '--num-iterations', + default=1, + type=int, + help='The number of times to run the test.', ) return parser diff --git a/scripts/regenerate-lock-files b/scripts/regenerate-lock-files index 56554c1e1542..fa7e8c67f93d 100755 --- a/scripts/regenerate-lock-files +++ b/scripts/regenerate-lock-files @@ -14,6 +14,7 @@ """This script is to programatically regenerate the requirements/*-lock.txt files. In order to run it you need to have pip-tools installed into the currently active virtual environment.""" + import argparse import sys import os @@ -124,10 +125,10 @@ def show_file(path: Path): def main( - build_directory: Path, - should_show_files: bool, - include_sdist: bool, - include_base: bool + build_directory: Path, + should_show_files: bool, + include_sdist: bool, + include_base: bool, ): builder = LockFileBuilder( source_directory=ROOT, @@ -204,13 +205,24 @@ if __name__ == "__main__": help=("Default base directory where output lock files to be written."), ) parser.add_argument('--show-files', action='store_true') - parser.add_argument('--no-show-files', action='store_false', dest='show_files') + parser.add_argument( + '--no-show-files', action='store_false', dest='show_files' + ) parser.set_defaults(show_files=False) parser.add_argument('--include-sdist', action='store_true') - parser.add_argument('--no-include-sdist', action='store_false', dest='include_sdist') + parser.add_argument( + '--no-include-sdist', action='store_false', dest='include_sdist' + ) parser.set_defaults(include_sdist=True) parser.add_argument('--include-base', action='store_true') - parser.add_argument('--no-include-base', action='store_false', dest='include_base') + parser.add_argument( + '--no-include-base', action='store_false', dest='include_base' + ) parser.set_defaults(include_base=False) args = parser.parse_args() - main(args.output_directory, args.show_files, args.include_sdist, args.include_base) + main( + args.output_directory, + args.show_files, + args.include_sdist, + args.include_base, + ) diff --git a/scripts/utils.py b/scripts/utils.py index 3d5bfaa8c722..59c47b6408fc 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -9,6 +9,7 @@ import zipfile import glob + class BadRCError(Exception): pass @@ -31,8 +32,9 @@ def run(cmd, cwd=None, env=None, echo=True): stdout, stderr = p.communicate() output = stdout.decode('utf-8') + stderr.decode('utf-8') if p.returncode != 0: - raise BadRCError("Bad rc (%s) for cmd '%s': %s" % ( - p.returncode, cmd, output)) + raise BadRCError( + "Bad rc (%s) for cmd '%s': %s" % (p.returncode, cmd, output) + ) return output