You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/02/05 09:46:20 UTC
[buildstream] 01/05: _frontend/cli.py: Removing support for
deprecated commands.
This is an automated email from the ASF dual-hosted git repository.
tvb pushed a commit to branch tristan/remote-cli-options
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 6ec5bf95bfc8ecb9f4bda0b1e5e66fc3dc1a2587
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Thu Feb 4 13:48:15 2021 +0900
_frontend/cli.py: Removing support for deprecated commands.
This has gone on long enough, there is no cause to keep supporting
these older forms of commands.
---
src/buildstream/_frontend/cli.py | 138 ---------------------------------------
tests/frontend/help.py | 2 +-
2 files changed, 1 insertion(+), 139 deletions(-)
diff --git a/src/buildstream/_frontend/cli.py b/src/buildstream/_frontend/cli.py
index ab06e8a..e1d84a7 100644
--- a/src/buildstream/_frontend/cli.py
+++ b/src/buildstream/_frontend/cli.py
@@ -1395,141 +1395,3 @@ def artifact_delete(app, artifacts, deps):
"""Remove artifacts from the local cache"""
with app.initialized():
app.stream.artifact_delete(artifacts, selection=deps)
-
-
-##################################################################
-# DEPRECATED Commands #
-##################################################################
-
-# XXX: The following commands are now obsolete, but they are kept
-# here along with all the options so that we can provide nice error
-# messages when they are called.
-# Also, note that these commands are hidden from the top-level help.
-
-##################################################################
-# Fetch Command #
-##################################################################
-@cli.command(short_help="COMMAND OBSOLETE - Fetch sources in a pipeline", hidden=True)
-@click.option(
- "--except",
- "except_",
- multiple=True,
- type=click.Path(readable=False),
- help="Except certain dependencies from fetching",
-)
-@click.option(
- "--deps",
- "-d",
- default=_PipelineSelection.PLAN,
- show_default=True,
- type=FastEnumType(_PipelineSelection, [_PipelineSelection.NONE, _PipelineSelection.PLAN, _PipelineSelection.ALL]),
- help="The dependencies to fetch",
-)
-@click.argument("elements", nargs=-1, type=click.Path(readable=False))
-@click.pass_obj
-def fetch(app, elements, deps, except_):
- click.echo("This command is now obsolete. Use `bst source fetch` instead.", err=True)
- sys.exit(1)
-
-
-##################################################################
-# Track Command #
-##################################################################
-@cli.command(short_help="COMMAND OBSOLETE - Track new source references", hidden=True)
-@click.option(
- "--except",
- "except_",
- multiple=True,
- type=click.Path(readable=False),
- help="Except certain dependencies from tracking",
-)
-@click.option(
- "--deps",
- "-d",
- default=_PipelineSelection.NONE,
- show_default=True,
- type=FastEnumType(_PipelineSelection, [_PipelineSelection.NONE, _PipelineSelection.ALL]),
- help="The dependencies to track",
-)
-@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)
- sys.exit(1)
-
-
-##################################################################
-# Checkout Command #
-##################################################################
-@cli.command(short_help="COMMAND OBSOLETE - Checkout a built artifact", hidden=True)
-@click.option("--force", "-f", is_flag=True, help="Allow files to be overwritten")
-@click.option(
- "--deps",
- "-d",
- default=_PipelineSelection.RUN,
- show_default=True,
- type=FastEnumType(_PipelineSelection, [_PipelineSelection.RUN, _PipelineSelection.BUILD, _PipelineSelection.NONE]),
- help="The dependencies to checkout",
-)
-@click.option("--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)")
-@click.option(
- "--tar",
- is_flag=True,
- help="Create a tarball from the artifact contents instead "
- "of a file tree. If LOCATION is '-', the tarball "
- "will be dumped to the standard output.",
-)
-@click.argument("element", required=False, type=click.Path(readable=False))
-@click.argument("location", type=click.Path(), required=False)
-@click.pass_obj
-def checkout(app, element, location, force, deps, integrate, hardlinks, tar):
- click.echo(
- "This command is now obsolete. Use `bst artifact checkout` instead "
- + "and use the --directory option to specify LOCATION",
- err=True,
- )
- sys.exit(1)
-
-
-################################################################
-# Pull Command #
-################################################################
-@cli.command(short_help="COMMAND OBSOLETE - Pull a built artifact", hidden=True)
-@click.option(
- "--deps",
- "-d",
- default=_PipelineSelection.NONE,
- show_default=True,
- type=FastEnumType(_PipelineSelection, [_PipelineSelection.NONE, _PipelineSelection.ALL]),
- help="The dependency artifacts to pull",
-)
-@click.option("--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)
- sys.exit(1)
-
-
-##################################################################
-# Push Command #
-##################################################################
-@cli.command(short_help="COMMAND OBSOLETE - Push a built artifact", hidden=True)
-@click.option(
- "--deps",
- "-d",
- default=_PipelineSelection.NONE,
- show_default=True,
- type=FastEnumType(_PipelineSelection, [_PipelineSelection.NONE, _PipelineSelection.ALL]),
- help="The dependencies to push",
-)
-@click.option(
- "--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)
- sys.exit(1)
diff --git a/tests/frontend/help.py b/tests/frontend/help.py
index 20a9316..bbb2ba9 100644
--- a/tests/frontend/help.py
+++ b/tests/frontend/help.py
@@ -20,7 +20,7 @@ def test_help_main(cli):
@pytest.mark.parametrize(
- "command", [("artifact"), ("build"), ("checkout"), ("shell"), ("show"), ("source"), ("workspace")]
+ "command", [("artifact"), ("build"), ("shell"), ("show"), ("source"), ("workspace")]
)
def test_help(cli, command):
result = cli.run(args=[command, "--help"])