From f2ccc5043891e702c0c6eba42ae2e7d1a2fd9abe Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Wed, 20 Jan 2021 12:18:29 +0100 Subject: [PATCH] clean deprecated commands --- pype/cli.py | 55 +++++++---------------------------------------------- start.py | 5 +++++ 2 files changed, 12 insertions(+), 48 deletions(-) diff --git a/pype/cli.py b/pype/cli.py index 1f7834a91e..62975bff31 100644 --- a/pype/cli.py +++ b/pype/cli.py @@ -11,6 +11,10 @@ from .pype_commands import PypeCommands @click.group(invoke_without_command=True) @click.pass_context +@click.option("--use-version", + expose_value=False, help="use specified version") +@click.option("--use-staging", is_flag=True, + expose_value=False, help="use staging variants") def main(ctx): """Pype is main command serving as entry point to pipeline system. @@ -42,12 +46,6 @@ def tray(debug=False): PypeCommands().launch_tray(debug) -@main.command() -def mongodb(): - """Launch local mongodb server. Useful for development.""" - PypeCommands().launch_local_mongodb() - - @main.command() @click.option("-d", "--debug", is_flag=True, help="Print debug messages") @click.option("--ftrack-url", envvar="FTRACK_SERVER", @@ -60,7 +58,7 @@ def mongodb(): envvar="FTRACK_EVENTS_PATH", help=("path to ftrack event handlers")) @click.option("--no-stored-credentials", is_flag=True, - help="dont use stored credentials") + help="don't use stored credentials") @click.option("--store-credentials", is_flag=True, help="store provided credentials") @click.option("--legacy", is_flag=True, @@ -169,41 +167,6 @@ def texturecopy(debug, project, asset, path): PypeCommands().texture_copy(project, asset, path) -@main.command() -@click.option("-k", "--keyword", help="select tests by keyword to run", - type=click.STRING) -@click.argument("id", nargs=-1, type=click.STRING) -def test(pype, keyword, id): - """Run test suite.""" - if pype: - PypeCommands().run_pype_tests(keyword, id) - - -@main.command() -def make_docs(): - """Generate documentation with Sphinx into `docs/build`.""" - PypeCommands().make_docs() - - -@main.command() -def coverage(): - """Generate code coverage report.""" - PypeCommands().pype_setup_coverage() - - -@main.command() -def clean(): - """Delete python bytecode files. - - Working throughout Pype directory, it will remove all pyc bytecode files. - This is normally not needed but there are cases when update of repostories - caused errors thanks to these files. If you encounter errors complaining - about `magic number`, run this command. - """ - # TODO: reimplement in Python - pass - - @main.command(context_settings={"ignore_unknown_options": True}) @click.option("--app", help="Registered application name") @click.option("--project", help="Project name", @@ -237,7 +200,9 @@ def launch(app, project, asset, task, Optionally you can specify ftrack credentials if needed. ARGUMENTS are passed to launched application. + """ + # TODO: this needs to switch for Settings if ftrack_server: os.environ["FTRACK_SERVER"] = ftrack_server @@ -258,12 +223,6 @@ def launch(app, project, asset, task, PypeCommands().run_application(app, project, asset, task, tools, arguments) -@main.command() -def validate_config(): - """Validate all json configuration files for errors.""" - PypeCommands().validate_jsons() - - @main.command() @click.option("-p", "--path", help="Path to zip file", default=None) def generate_zip(path): diff --git a/start.py b/start.py index 2b450c0c3f..94b1675e23 100644 --- a/start.py +++ b/start.py @@ -219,6 +219,11 @@ def _process_arguments() -> tuple: use_version = None use_staging = False for arg in sys.argv: + if arg == "--use-version": + print("!!! Please use option --use-version like:") + print(" --use-version=3.0.0") + sys.exit(1) + m = re.search(r"--use-version=(?P\d+\.\d+\.\d*.+?)", arg) if m and m.group('version'): use_version = m.group('version')