From e72dc25dfd5ff8e9fcbec3fe71168eb238087fc7 Mon Sep 17 00:00:00 2001 From: Patricia Grubel Date: Wed, 6 Sep 2023 15:49:21 -0600 Subject: [PATCH 1/3] Switch --version command from core to beeflow. --- beeflow/client/bee_client.py | 9 +++++++++ beeflow/client/core.py | 10 +--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/beeflow/client/bee_client.py b/beeflow/client/bee_client.py index e24a74b2b..a67443380 100644 --- a/beeflow/client/bee_client.py +++ b/beeflow/client/bee_client.py @@ -14,6 +14,7 @@ import tempfile import textwrap import time +import importlib.metadata import jsonpickle import requests import typer @@ -535,6 +536,14 @@ def reexecute(wf_name: str = typer.Argument(..., help='The workflow name'), logging.info(f'ReExecute Workflow: {resp.text}') return wf_id +@app.callback(invoke_without_command=True) +def version_callback(version: bool = False): + """Beeflow.""" + # Print out the current version of the app, and then exit + # Note above docstring gets used in the help menu + if version: + version = importlib.metadata.version("hpc-beeflow") + print(version) def main(): """Execute bee_client.""" diff --git a/beeflow/client/core.py b/beeflow/client/core.py index 7805eaf38..3863411ed 100644 --- a/beeflow/client/core.py +++ b/beeflow/client/core.py @@ -15,7 +15,6 @@ import sys import shutil import time -import importlib.metadata import daemon import typer @@ -391,11 +390,4 @@ def restart(foreground: bool = typer.Option(False, '--foreground', '-F', start(foreground) -@app.callback(invoke_without_command=True) -def version_callback(version: bool = False): - """Beeflow.""" - # Print out the current version of the app, and then exit - # Note above docstring gets used in the help menu - if version: - version = importlib.metadata.version("hpc-beeflow") - print(version) + From b4dfe7f79f3c812834133409a7520a03bb20ea5c Mon Sep 17 00:00:00 2001 From: Patricia Grubel Date: Wed, 6 Sep 2023 15:57:23 -0600 Subject: [PATCH 2/3] Pylama fixes --- beeflow/client/bee_client.py | 2 ++ beeflow/client/core.py | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/beeflow/client/bee_client.py b/beeflow/client/bee_client.py index a67443380..9cd2379b8 100644 --- a/beeflow/client/bee_client.py +++ b/beeflow/client/bee_client.py @@ -536,6 +536,7 @@ def reexecute(wf_name: str = typer.Argument(..., help='The workflow name'), logging.info(f'ReExecute Workflow: {resp.text}') return wf_id + @app.callback(invoke_without_command=True) def version_callback(version: bool = False): """Beeflow.""" @@ -545,6 +546,7 @@ def version_callback(version: bool = False): version = importlib.metadata.version("hpc-beeflow") print(version) + def main(): """Execute bee_client.""" global _INTERACTIVE diff --git a/beeflow/client/core.py b/beeflow/client/core.py index 3863411ed..24a37bf4a 100644 --- a/beeflow/client/core.py +++ b/beeflow/client/core.py @@ -389,5 +389,3 @@ def restart(foreground: bool = typer.Option(False, '--foreground', '-F', stop() start(foreground) - - From 7c72d23d5ee10eb3eace5ab897e527e4c30fd19b Mon Sep 17 00:00:00 2001 From: Patricia Grubel Date: Wed, 6 Sep 2023 16:01:08 -0600 Subject: [PATCH 3/3] Pylama extra line fix --- beeflow/client/core.py | 1 - 1 file changed, 1 deletion(-) diff --git a/beeflow/client/core.py b/beeflow/client/core.py index 24a37bf4a..4c759adf1 100644 --- a/beeflow/client/core.py +++ b/beeflow/client/core.py @@ -388,4 +388,3 @@ def restart(foreground: bool = typer.Option(False, '--foreground', '-F', """Attempt to stop and restart the beeflow daemon.""" stop() start(foreground) -