clean deprecated commands

This commit is contained in:
Ondrej Samohel 2021-01-20 12:18:29 +01:00 committed by Ondřej Samohel
parent 8df840995e
commit f2ccc50438
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
2 changed files with 12 additions and 48 deletions

View file

@ -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):

View file

@ -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<version>\d+\.\d+\.\d*.+?)", arg)
if m and m.group('version'):
use_version = m.group('version')