diff --git a/fedn/cli/main.py b/fedn/cli/main.py index d6f912e62..0d5660c0b 100644 --- a/fedn/cli/main.py +++ b/fedn/cli/main.py @@ -1,3 +1,5 @@ +import importlib.metadata + import click CONTEXT_SETTINGS = dict( @@ -5,10 +7,16 @@ help_option_names=["-h", "--help"], ) +# Dynamically get the version of the package +try: + version = importlib.metadata.version("fedn") +except importlib.metadata.PackageNotFoundError: + version = "unknown" + @click.group(context_settings=CONTEXT_SETTINGS) +@click.version_option(version) @click.pass_context def main(ctx): - """:param ctx: - """ + """:param ctx:""" ctx.obj = dict() diff --git a/fedn/common/config.py b/fedn/common/config.py index 4864ce1ef..94b346d65 100644 --- a/fedn/common/config.py +++ b/fedn/common/config.py @@ -2,9 +2,6 @@ import yaml -global STATESTORE_CONFIG -global MODELSTORAGE_CONFIG - SECRET_KEY = os.environ.get("FEDN_JWT_SECRET_KEY", False) FEDN_JWT_CUSTOM_CLAIM_KEY = os.environ.get("FEDN_JWT_CUSTOM_CLAIM_KEY", False) FEDN_JWT_CUSTOM_CLAIM_VALUE = os.environ.get("FEDN_JWT_CUSTOM_CLAIM_VALUE", False) diff --git a/fedn/network/combiner/roundhandler.py b/fedn/network/combiner/roundhandler.py index ef9029de9..816957323 100644 --- a/fedn/network/combiner/roundhandler.py +++ b/fedn/network/combiner/roundhandler.py @@ -309,7 +309,6 @@ def _assign_round_clients(self, n, type="trainers"): clients = self.server.get_active_trainers() else: logger.error("(ERROR): {} is not a supported type of client".format(type)) - raise # If the number of requested trainers exceeds the number of available, use all available. if n > len(clients):