diff options
Diffstat (limited to 'src/buildstream/_frontend/cli.py')
-rw-r--r-- | src/buildstream/_frontend/cli.py | 370 |
1 files changed, 81 insertions, 289 deletions
diff --git a/src/buildstream/_frontend/cli.py b/src/buildstream/_frontend/cli.py index 9a73ab375..bffcf3786 100644 --- a/src/buildstream/_frontend/cli.py +++ b/src/buildstream/_frontend/cli.py @@ -54,9 +54,7 @@ def search_command(args, *, context=None): command = command_ctx.command.get_command(command_ctx, cmd) if command is None: return None - command_ctx = command.make_context( - command.name, [command.name], parent=command_ctx, resilient_parsing=True - ) + command_ctx = command.make_context(command.name, [command.name], parent=command_ctx, resilient_parsing=True) return command_ctx @@ -64,11 +62,7 @@ def search_command(args, *, context=None): # Completion for completing command names as help arguments def complete_commands(cmd, args, incomplete): command_ctx = search_command(args[1:]) - if ( - command_ctx - and command_ctx.command - and isinstance(command_ctx.command, click.MultiCommand) - ): + if command_ctx and command_ctx.command and isinstance(command_ctx.command, click.MultiCommand): return [ subcommand + " " for subcommand in command_ctx.command.list_commands(command_ctx) @@ -108,9 +102,7 @@ def complete_target(args, incomplete): else: # Check if this directory or any of its parent directories # contain a project config file - base_directory, _ = utils._search_upward_for_files( - base_directory, [project_conf] - ) + base_directory, _ = utils._search_upward_for_files(base_directory, [project_conf]) if base_directory is None: # No project_conf was found in base_directory or its parents, no need @@ -164,11 +156,7 @@ def complete_artifact(orig_args, args, incomplete): # element targets are valid artifact names complete_list = complete_target(args, incomplete) - complete_list.extend( - ref - for ref in ctx.artifactcache.list_artifacts() - if ref.startswith(incomplete) - ) + complete_list.extend(ref for ref in ctx.artifactcache.list_artifacts() if ref.startswith(incomplete)) return complete_list @@ -216,10 +204,7 @@ def validate_output_streams(): flags = fcntl.fcntl(fileno, fcntl.F_GETFL) if flags & os.O_NONBLOCK: click.echo( - "{} is currently set to O_NONBLOCK, try opening a new shell".format( - stream.name - ), - err=True, + "{} is currently set to O_NONBLOCK, try opening a new shell".format(stream.name), err=True, ) sys.exit(-1) @@ -232,8 +217,7 @@ def handle_bst_force_start_method_env(): if existing_start_method is None: multiprocessing.set_start_method(start_method) print( - bst_force_start_method_str - + ": multiprocessing start method forced to:", + bst_force_start_method_str + ": multiprocessing start method forced to:", start_method, file=sys.stderr, flush=True, @@ -243,16 +227,14 @@ def handle_bst_force_start_method_env(): # multiple times in the same executable, so guard against that # here. print( - bst_force_start_method_str - + ": multiprocessing start method already set to:", + bst_force_start_method_str + ": multiprocessing start method already set to:", existing_start_method, file=sys.stderr, flush=True, ) else: print( - bst_force_start_method_str - + ": cannot set multiprocessing start method to:", + bst_force_start_method_str + ": cannot set multiprocessing start method to:", start_method, ", already set to:", existing_start_method, @@ -262,9 +244,7 @@ def handle_bst_force_start_method_env(): sys.exit(-1) -def override_main( - self, args=None, prog_name=None, complete_var=None, standalone_mode=True, **extra -): +def override_main(self, args=None, prog_name=None, complete_var=None, standalone_mode=True, **extra): # Hook for the Bash completion. This only activates if the Bash # completion is actually enabled, otherwise this is quite a fast @@ -295,14 +275,7 @@ def override_main( # case of testing, our tests preceed our entrypoint, so we do our best. handle_bst_force_start_method_env() - original_main( - self, - args=args, - prog_name=prog_name, - complete_var=None, - standalone_mode=standalone_mode, - **extra - ) + original_main(self, args=args, prog_name=prog_name, complete_var=None, standalone_mode=standalone_mode, **extra) original_main = click.BaseCommand.main @@ -325,14 +298,9 @@ def print_version(ctx, param, value): @click.group(context_settings=dict(help_option_names=["-h", "--help"])) +@click.option("--version", is_flag=True, callback=print_version, expose_value=False, is_eager=True) @click.option( - "--version", is_flag=True, callback=print_version, expose_value=False, is_eager=True -) -@click.option( - "--config", - "-c", - type=click.Path(exists=True, dir_okay=False, readable=True), - help="Configuration file to use", + "--config", "-c", type=click.Path(exists=True, dir_okay=False, readable=True), help="Configuration file to use", ) @click.option( "--directory", @@ -348,47 +316,26 @@ def print_version(ctx, param, value): help="What to do when an error is encountered", ) @click.option( - "--fetchers", - type=click.INT, - default=None, - help="Maximum simultaneous download tasks", + "--fetchers", type=click.INT, default=None, help="Maximum simultaneous download tasks", ) +@click.option("--builders", type=click.INT, default=None, help="Maximum simultaneous build tasks") +@click.option("--pushers", type=click.INT, default=None, help="Maximum simultaneous upload tasks") @click.option( - "--builders", type=click.INT, default=None, help="Maximum simultaneous build tasks" + "--max-jobs", type=click.INT, default=None, help="Number of parallel jobs allowed for a given build task", ) @click.option( - "--pushers", type=click.INT, default=None, help="Maximum simultaneous upload tasks" + "--network-retries", type=click.INT, default=None, help="Maximum retries for network tasks", ) @click.option( - "--max-jobs", - type=click.INT, - default=None, - help="Number of parallel jobs allowed for a given build task", -) -@click.option( - "--network-retries", - type=click.INT, - default=None, - help="Maximum retries for network tasks", -) -@click.option( - "--no-interactive", - is_flag=True, - help="Force non interactive mode, otherwise this is automatically decided", + "--no-interactive", is_flag=True, help="Force non interactive mode, otherwise this is automatically decided", ) @click.option("--verbose/--no-verbose", default=None, help="Be extra verbose") @click.option("--debug/--no-debug", default=None, help="Print debugging output") @click.option( - "--error-lines", - type=click.INT, - default=None, - help="Maximum number of lines to show from a task log", + "--error-lines", type=click.INT, default=None, help="Maximum number of lines to show from a task log", ) @click.option( - "--message-lines", - type=click.INT, - default=None, - help="Maximum number of lines to show in a detailed message", + "--message-lines", type=click.INT, default=None, help="Maximum number of lines to show in a detailed message", ) @click.option( "--log-file", @@ -396,9 +343,7 @@ def print_version(ctx, param, value): help="A file to store the main log (allows storing the main log while in interactive mode)", ) @click.option( - "--colors/--no-colors", - default=None, - help="Force enable/disable ANSI color codes in output", + "--colors/--no-colors", default=None, help="Force enable/disable ANSI color codes in output", ) @click.option( "--strict/--no-strict", @@ -415,9 +360,7 @@ def print_version(ctx, param, value): help="Specify a project option", ) @click.option( - "--default-mirror", - default=None, - help="The mirror to fetch from first, before attempting other mirrors", + "--default-mirror", default=None, help="The mirror to fetch from first, before attempting other mirrors", ) @click.option( "--pull-buildtrees", @@ -450,9 +393,7 @@ def cli(context, **kwargs): # Help Command # ################################################################## @cli.command( - name="help", - short_help="Print usage information", - context_settings={"help_option_names": []}, + name="help", short_help="Print usage information", context_settings={"help_option_names": []}, ) @click.argument("command", nargs=-1, metavar="COMMAND") @click.pass_context @@ -462,10 +403,7 @@ def help_command(ctx, command): command_ctx = search_command(command, context=ctx.parent) if not command_ctx: click.echo( - "Not a valid command: '{} {}'".format( - ctx.parent.info_name, " ".join(command) - ), - err=True, + "Not a valid command: '{} {}'".format(ctx.parent.info_name, " ".join(command)), err=True, ) sys.exit(-1) @@ -477,10 +415,7 @@ def help_command(ctx, command): if command: detail = " {} ".format(" ".join(command)) click.echo( - "\nFor usage on a specific command: {} help{}COMMAND".format( - ctx.parent.info_name, detail - ), - err=True, + "\nFor usage on a specific command: {} help{}COMMAND".format(ctx.parent.info_name, detail), err=True, ) @@ -503,14 +438,9 @@ def help_command(ctx, command): show_default=True, help="The subdirectory to store elements in", ) -@click.option( - "--force", "-f", is_flag=True, help="Allow overwriting an existing project.conf" -) +@click.option("--force", "-f", is_flag=True, help="Allow overwriting an existing project.conf") @click.argument( - "target-directory", - nargs=1, - required=False, - type=click.Path(file_okay=False, writable=True), + "target-directory", nargs=1, required=False, type=click.Path(file_okay=False, writable=True), ) @click.pass_obj def init(app, project_name, format_version, element_path, force, target_directory): @@ -522,9 +452,7 @@ def init(app, project_name, format_version, element_path, force, target_director Unless `--project-name` is specified, this will be an interactive session. """ - app.init_project( - project_name, format_version, element_path, force, target_directory - ) + app.init_project(project_name, format_version, element_path, force, target_directory) ################################################################## @@ -532,17 +460,10 @@ def init(app, project_name, format_version, element_path, force, target_director ################################################################## @cli.command(short_help="Build elements in a pipeline") @click.option( - "--deps", - "-d", - default=None, - type=click.Choice(["plan", "all"]), - help="The dependencies to build", + "--deps", "-d", default=None, type=click.Choice(["plan", "all"]), help="The dependencies to build", ) @click.option( - "--remote", - "-r", - default=None, - help="The URL of the remote cache (defaults to the first configured cache)", + "--remote", "-r", default=None, help="The URL of the remote cache (defaults to the first configured cache)", ) @click.argument("elements", nargs=-1, type=click.Path(readable=False)) @click.pass_obj @@ -574,10 +495,7 @@ def build(app, elements, deps, remote): ignore_junction_targets = True app.stream.build( - elements, - selection=deps, - ignore_junction_targets=ignore_junction_targets, - remote=remote, + elements, selection=deps, ignore_junction_targets=ignore_junction_targets, remote=remote, ) @@ -586,11 +504,7 @@ def build(app, elements, deps, remote): ################################################################## @cli.command(short_help="Show elements in the pipeline") @click.option( - "--except", - "except_", - multiple=True, - type=click.Path(readable=False), - help="Except certain dependencies", + "--except", "except_", multiple=True, type=click.Path(readable=False), help="Except certain dependencies", ) @click.option( "--deps", @@ -679,9 +593,7 @@ def show(app, elements, deps, except_, order, format_): if not elements: elements = app.project.get_default_targets() - dependencies = app.stream.load_selection( - elements, selection=deps, except_targets=except_ - ) + dependencies = app.stream.load_selection(elements, selection=deps, except_targets=except_) if order == "alpha": dependencies = sorted(dependencies) @@ -698,11 +610,7 @@ def show(app, elements, deps, except_, order, format_): ################################################################## @cli.command(short_help="Shell into an element's sandbox environment") @click.option( - "--build", - "-b", - "build_", - is_flag=True, - help="Stage dependencies and sources to build", + "--build", "-b", "build_", is_flag=True, help="Stage dependencies and sources to build", ) @click.option( "--sysroot", @@ -726,16 +634,10 @@ def show(app, elements, deps, except_, order, format_): type=click.Choice(["ask", "try", "always", "never"]), default="ask", show_default=True, - help=( - "Use a buildtree. If `always` is set, will always fail to " - "build if a buildtree is not available." - ), + help=("Use a buildtree. If `always` is set, will always fail to " "build if a buildtree is not available."), ) @click.option( - "--pull", - "pull_", - is_flag=True, - help="Attempt to pull missing or incomplete artifacts", + "--pull", "pull_", is_flag=True, help="Attempt to pull missing or incomplete artifacts", ) @click.argument("element", required=False, type=click.Path(readable=False)) @click.argument("command", type=click.STRING, nargs=-1) @@ -782,9 +684,7 @@ def shell(app, element, sysroot, mount, isolate, build_, cli_buildtree, pull_, c if not element: raise AppError('Missing argument "ELEMENT".') - elements = app.stream.load_selection( - (element,), selection=selection, use_artifact_config=True - ) + elements = app.stream.load_selection((element,), selection=selection, use_artifact_config=True) # last one will be the element we want to stage, previous ones are # elements to try and pull @@ -811,20 +711,15 @@ def shell(app, element, sysroot, mount, isolate, build_, cli_buildtree, pull_, c else: if cli_buildtree == "always": # Exit early if it won't be possible to even fetch a buildtree with always option - raise AppError( - "Artifact was created without buildtree, unable to launch shell with it" - ) + raise AppError("Artifact was created without buildtree, unable to launch shell with it") click.echo( - "WARNING: Artifact created without buildtree, shell will be loaded without it", - err=True, + "WARNING: Artifact created without buildtree, shell will be loaded without it", err=True, ) else: # If the value has defaulted to ask and in non interactive mode, don't consider the buildtree, this # being the default behaviour of the command if app.interactive and cli_buildtree == "ask": - if cached and bool( - click.confirm("Do you want to use the cached buildtree?") - ): + if cached and bool(click.confirm("Do you want to use the cached buildtree?")): use_buildtree = "always" elif buildtree_exists: try: @@ -858,9 +753,7 @@ def shell(app, element, sysroot, mount, isolate, build_, cli_buildtree, pull_, c pull_dependencies=pull_dependencies, ) except BstError as e: - raise AppError( - "Error launching shell: {}".format(e), detail=e.detail - ) from e + raise AppError("Error launching shell: {}".format(e), detail=e.detail) from e # If there were no errors, we return the shell's exit code here. sys.exit(exitcode) @@ -894,22 +787,13 @@ def source(): help="The dependencies to fetch", ) @click.option( - "--track", - "track_", - is_flag=True, - help="Track new source references before fetching", + "--track", "track_", is_flag=True, help="Track new source references before fetching", ) @click.option( - "--track-cross-junctions", - "-J", - is_flag=True, - help="Allow tracking to cross junction boundaries", + "--track-cross-junctions", "-J", is_flag=True, help="Allow tracking to cross junction boundaries", ) @click.option( - "--remote", - "-r", - default=None, - help="The URL of the remote source cache (defaults to the first configured cache)", + "--remote", "-r", default=None, help="The URL of the remote source cache (defaults to the first configured cache)", ) @click.argument("elements", nargs=-1, type=click.Path(readable=False)) @click.pass_obj @@ -939,8 +823,7 @@ def source_fetch(app, elements, deps, track_, except_, track_cross_junctions, re if track_cross_junctions and not track_: click.echo( - "ERROR: The --track-cross-junctions option can only be used with --track", - err=True, + "ERROR: The --track-cross-junctions option can only be used with --track", err=True, ) sys.exit(-1) @@ -985,9 +868,7 @@ def source_fetch(app, elements, deps, track_, except_, track_cross_junctions, re type=click.Choice(["none", "all"]), help="The dependencies to track", ) -@click.option( - "--cross-junctions", "-J", is_flag=True, help="Allow crossing junction boundaries" -) +@click.option("--cross-junctions", "-J", is_flag=True, help="Allow crossing junction boundaries") @click.argument("elements", nargs=-1, type=click.Path(readable=False)) @click.pass_obj def source_track(app, elements, deps, except_, cross_junctions): @@ -1021,10 +902,7 @@ def source_track(app, elements, deps, except_, cross_junctions): if deps == "none": deps = "redirect" app.stream.track( - elements, - selection=deps, - except_targets=except_, - cross_junctions=cross_junctions, + elements, selection=deps, except_targets=except_, cross_junctions=cross_junctions, ) @@ -1034,11 +912,7 @@ def source_track(app, elements, deps, except_, cross_junctions): @source.command(name="checkout", short_help="Checkout sources of an element") @click.option("--force", "-f", is_flag=True, help="Allow files to be overwritten") @click.option( - "--except", - "except_", - multiple=True, - type=click.Path(readable=False), - help="Except certain dependencies", + "--except", "except_", multiple=True, type=click.Path(readable=False), help="Except certain dependencies", ) @click.option( "--deps", @@ -1070,9 +944,7 @@ def source_track(app, elements, deps, except_, cross_junctions): ) @click.argument("element", required=False, type=click.Path(readable=False)) @click.pass_obj -def source_checkout( - app, element, directory, force, deps, except_, tar, compression, build_scripts -): +def source_checkout(app, element, directory, force, deps, except_, tar, compression, build_scripts): """Checkout sources of an element to the specified location When this command is executed from a workspace directory, the default @@ -1122,9 +994,7 @@ def workspace(): ################################################################## @workspace.command(name="open", short_help="Open a new workspace") @click.option( - "--no-checkout", - is_flag=True, - help="Do not checkout the source, only link to the given directory", + "--no-checkout", is_flag=True, help="Do not checkout the source, only link to the given directory", ) @click.option( "--force", @@ -1134,10 +1004,7 @@ def workspace(): + "or if a workspace for that element already exists", ) @click.option( - "--track", - "track_", - is_flag=True, - help="Track and fetch new source references before checking out the workspace", + "--track", "track_", is_flag=True, help="Track and fetch new source references before checking out the workspace", ) @click.option( "--directory", @@ -1152,11 +1019,7 @@ def workspace_open(app, no_checkout, force, track_, directory, elements): with app.initialized(): app.stream.workspace_open( - elements, - no_checkout=no_checkout, - track_first=track_, - force=force, - custom_dir=directory, + elements, no_checkout=no_checkout, track_first=track_, force=force, custom_dir=directory, ) @@ -1165,9 +1028,7 @@ def workspace_open(app, no_checkout, force, track_, directory, elements): ################################################################## @workspace.command(name="close", short_help="Close workspaces") @click.option( - "--remove-dir", - is_flag=True, - help="Remove the path that contains the closed workspace", + "--remove-dir", is_flag=True, help="Remove the path that contains the closed workspace", ) @click.option("--all", "-a", "all_", is_flag=True, help="Close all open workspaces") @click.argument("elements", nargs=-1, type=click.Path(readable=False)) @@ -1193,9 +1054,7 @@ def workspace_close(app, remove_dir, all_, elements): sys.exit(0) if all_: - elements = [ - element_name for element_name, _ in app.context.get_workspaces().list() - ] + elements = [element_name for element_name, _ in app.context.get_workspaces().list()] elements = app.stream.redirect_element_names(elements) @@ -1227,14 +1086,9 @@ def workspace_close(app, remove_dir, all_, elements): # Workspace Reset Command # ################################################################## @workspace.command(name="reset", short_help="Reset a workspace to its original state") +@click.option("--soft", is_flag=True, help="Reset workspace state without affecting its contents") @click.option( - "--soft", is_flag=True, help="Reset workspace state without affecting its contents" -) -@click.option( - "--track", - "track_", - is_flag=True, - help="Track and fetch the latest source before resetting", + "--track", "track_", is_flag=True, help="Track and fetch the latest source before resetting", ) @click.option("--all", "-a", "all_", is_flag=True, help="Reset all open workspaces") @click.argument("elements", nargs=-1, type=click.Path(readable=False)) @@ -1256,9 +1110,7 @@ def workspace_reset(app, soft, track_, all_, elements): raise AppError("No open workspaces to reset") if all_: - elements = tuple( - element_name for element_name, _ in app.context.get_workspaces().list() - ) + elements = tuple(element_name for element_name, _ in app.context.get_workspaces().list()) app.stream.workspace_reset(elements, soft=soft, track_first=track_) @@ -1344,15 +1196,10 @@ def artifact_show(app, deps, artifacts): help="The dependencies to checkout", ) @click.option( - "--integrate/--no-integrate", - default=None, - is_flag=True, - help="Whether to run integration commands", + "--integrate/--no-integrate", default=None, is_flag=True, help="Whether to run integration commands", ) @click.option( - "--hardlinks", - is_flag=True, - help="Checkout hardlinks instead of copying if possible", + "--hardlinks", is_flag=True, help="Checkout hardlinks instead of copying if possible", ) @click.option( "--tar", @@ -1370,22 +1217,14 @@ def artifact_show(app, deps, artifacts): help="The compression option of the tarball created.", ) @click.option( - "--pull", - "pull_", - is_flag=True, - help="Pull the artifact if it's missing or incomplete.", + "--pull", "pull_", is_flag=True, help="Pull the artifact if it's missing or incomplete.", ) @click.option( - "--directory", - default=None, - type=click.Path(file_okay=False), - help="The directory to checkout the artifact to", + "--directory", default=None, type=click.Path(file_okay=False), help="The directory to checkout the artifact to", ) @click.argument("target", required=False, type=click.Path(readable=False)) @click.pass_obj -def artifact_checkout( - app, force, deps, integrate, hardlinks, tar, compression, pull_, directory, target -): +def artifact_checkout(app, force, deps, integrate, hardlinks, tar, compression, pull_, directory, target): """Checkout contents of an artifact When this command is executed from a workspace directory, the default @@ -1402,8 +1241,7 @@ def artifact_checkout( if not tar: if compression: click.echo( - "ERROR: --compression can only be provided if --tar is provided", - err=True, + "ERROR: --compression can only be provided if --tar is provided", err=True, ) sys.exit(-1) else: @@ -1420,15 +1258,10 @@ def artifact_checkout( inferred_compression = _get_compression(tar) except UtilError as e: click.echo( - "ERROR: Invalid file extension given with '--tar': {}".format(e), - err=True, + "ERROR: Invalid file extension given with '--tar': {}".format(e), err=True, ) sys.exit(-1) - if ( - compression - and inferred_compression != "" - and inferred_compression != compression - ): + if compression and inferred_compression != "" and inferred_compression != compression: click.echo( "WARNING: File extension and compression differ." "File extension has been overridden by --compression", @@ -1469,10 +1302,7 @@ def artifact_checkout( help="The dependency artifacts to pull", ) @click.option( - "--remote", - "-r", - default=None, - help="The URL of the remote cache (defaults to the first configured cache)", + "--remote", "-r", default=None, help="The URL of the remote cache (defaults to the first configured cache)", ) @click.argument("artifacts", nargs=-1, type=click.Path(readable=False)) @click.pass_obj @@ -1506,10 +1336,7 @@ def artifact_pull(app, artifacts, deps, remote): ignore_junction_targets = True app.stream.pull( - artifacts, - selection=deps, - remote=remote, - ignore_junction_targets=ignore_junction_targets, + artifacts, selection=deps, remote=remote, ignore_junction_targets=ignore_junction_targets, ) @@ -1526,10 +1353,7 @@ def artifact_pull(app, artifacts, deps, remote): help="The dependencies to push", ) @click.option( - "--remote", - "-r", - default=None, - help="The URL of the remote cache (defaults to the first configured cache)", + "--remote", "-r", default=None, help="The URL of the remote cache (defaults to the first configured cache)", ) @click.argument("artifacts", nargs=-1, type=click.Path(readable=False)) @click.pass_obj @@ -1565,10 +1389,7 @@ def artifact_push(app, artifacts, deps, remote): ignore_junction_targets = True app.stream.push( - artifacts, - selection=deps, - remote=remote, - ignore_junction_targets=ignore_junction_targets, + artifacts, selection=deps, remote=remote, ignore_junction_targets=ignore_junction_targets, ) @@ -1624,11 +1445,7 @@ def artifact_log(app, artifacts, out): ################################################################ @artifact.command(name="list-contents", short_help="List the contents of an artifact") @click.option( - "--long", - "-l", - "long_", - is_flag=True, - help="Provide more information about the contents of the artifact.", + "--long", "-l", "long_", is_flag=True, help="Provide more information about the contents of the artifact.", ) @click.argument("artifacts", type=click.Path(), nargs=-1) @click.pass_obj @@ -1698,23 +1515,15 @@ def artifact_delete(app, artifacts, deps): help="The dependencies to fetch", ) @click.option( - "--track", - "track_", - is_flag=True, - help="Track new source references before fetching", + "--track", "track_", is_flag=True, help="Track new source references before fetching", ) @click.option( - "--track-cross-junctions", - "-J", - is_flag=True, - help="Allow tracking to cross junction boundaries", + "--track-cross-junctions", "-J", is_flag=True, help="Allow tracking to cross junction boundaries", ) @click.argument("elements", nargs=-1, type=click.Path(readable=False)) @click.pass_obj def fetch(app, elements, deps, track_, except_, track_cross_junctions): - click.echo( - "This command is now obsolete. Use `bst source fetch` instead.", err=True - ) + click.echo("This command is now obsolete. Use `bst source fetch` instead.", err=True) sys.exit(1) @@ -1737,15 +1546,11 @@ def fetch(app, elements, deps, track_, except_, track_cross_junctions): type=click.Choice(["none", "all"]), help="The dependencies to track", ) -@click.option( - "--cross-junctions", "-J", is_flag=True, help="Allow crossing junction boundaries" -) +@click.option("--cross-junctions", "-J", is_flag=True, help="Allow crossing junction boundaries") @click.argument("elements", nargs=-1, type=click.Path(readable=False)) @click.pass_obj def track(app, elements, deps, except_, cross_junctions): - click.echo( - "This command is now obsolete. Use `bst source track` instead.", err=True - ) + click.echo("This command is now obsolete. Use `bst source track` instead.", err=True) sys.exit(1) @@ -1763,14 +1568,10 @@ def track(app, elements, deps, except_, cross_junctions): help="The dependencies to checkout", ) @click.option( - "--integrate/--no-integrate", - default=True, - help="Run integration commands (default is to run commands)", + "--integrate/--no-integrate", default=True, help="Run integration commands (default is to run commands)", ) @click.option( - "--hardlinks", - is_flag=True, - help="Checkout hardlinks instead of copies (handle with care)", + "--hardlinks", is_flag=True, help="Checkout hardlinks instead of copies (handle with care)", ) @click.option( "--tar", @@ -1804,16 +1605,12 @@ def checkout(app, element, location, force, deps, integrate, hardlinks, tar): help="The dependency artifacts to pull", ) @click.option( - "--remote", - "-r", - help="The URL of the remote cache (defaults to the first configured cache)", + "--remote", "-r", help="The URL of the remote cache (defaults to the first configured cache)", ) @click.argument("elements", nargs=-1, type=click.Path(readable=False)) @click.pass_obj def pull(app, elements, deps, remote): - click.echo( - "This command is now obsolete. Use `bst artifact pull` instead.", err=True - ) + click.echo("This command is now obsolete. Use `bst artifact pull` instead.", err=True) sys.exit(1) @@ -1830,15 +1627,10 @@ def pull(app, elements, deps, remote): help="The dependencies to push", ) @click.option( - "--remote", - "-r", - default=None, - help="The URL of the remote cache (defaults to the first configured cache)", + "--remote", "-r", default=None, help="The URL of the remote cache (defaults to the first configured cache)", ) @click.argument("elements", nargs=-1, type=click.Path(readable=False)) @click.pass_obj def push(app, elements, deps, remote): - click.echo( - "This command is now obsolete. Use `bst artifact push` instead.", err=True - ) + click.echo("This command is now obsolete. Use `bst artifact push` instead.", err=True) sys.exit(1) |