From ba333c302db1f7afed77a1a6d9554248d5f3c78f Mon Sep 17 00:00:00 2001 From: sowmyasri Date: Wed, 3 Jul 2024 15:43:41 +0200 Subject: [PATCH 1/6] added --version command for fedn package --- fedn/cli/main.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fedn/cli/main.py b/fedn/cli/main.py index d6f912e62..c2bb6d7c9 100644 --- a/fedn/cli/main.py +++ b/fedn/cli/main.py @@ -1,12 +1,17 @@ import click - +import importlib.metadata CONTEXT_SETTINGS = dict( # Support -h as a shortcut for --help 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: From f5e21cbb3c59114fbe682677bb842ada8e58dacb Mon Sep 17 00:00:00 2001 From: sowmyasri Date: Wed, 3 Jul 2024 16:30:00 +0200 Subject: [PATCH 2/6] fixed single quotes with double quotes --- fedn/cli/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedn/cli/main.py b/fedn/cli/main.py index c2bb6d7c9..68f196123 100644 --- a/fedn/cli/main.py +++ b/fedn/cli/main.py @@ -7,7 +7,7 @@ # Dynamically get the version of the package try: - version = importlib.metadata.version('fedn') + version = importlib.metadata.version("fedn") except importlib.metadata.PackageNotFoundError: version = 'unknown' @click.group(context_settings=CONTEXT_SETTINGS) From b5bf969439ffbd11150766fb3b6ad585353a75ee Mon Sep 17 00:00:00 2001 From: sowmyasri Date: Wed, 3 Jul 2024 16:34:41 +0200 Subject: [PATCH 3/6] fixed double quotes for version --- fedn/cli/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedn/cli/main.py b/fedn/cli/main.py index 68f196123..3f38e90fc 100644 --- a/fedn/cli/main.py +++ b/fedn/cli/main.py @@ -9,7 +9,7 @@ try: version = importlib.metadata.version("fedn") except importlib.metadata.PackageNotFoundError: - version = 'unknown' + version = "unknown" @click.group(context_settings=CONTEXT_SETTINGS) @click.version_option(version) @click.pass_context From 44206e509ce45d00909f75c11bf07cb21df1373b Mon Sep 17 00:00:00 2001 From: sowmyasri Date: Wed, 3 Jul 2024 16:39:05 +0200 Subject: [PATCH 4/6] intendation error fixed --- fedn/cli/main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fedn/cli/main.py b/fedn/cli/main.py index 3f38e90fc..0d5660c0b 100644 --- a/fedn/cli/main.py +++ b/fedn/cli/main.py @@ -1,5 +1,7 @@ -import click import importlib.metadata + +import click + CONTEXT_SETTINGS = dict( # Support -h as a shortcut for --help help_option_names=["-h", "--help"], @@ -10,10 +12,11 @@ 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() From efb3e4f962c0e1282d7bcd73482155705cfd2124 Mon Sep 17 00:00:00 2001 From: sowmyasri Date: Thu, 4 Jul 2024 11:15:21 +0200 Subject: [PATCH 5/6] fixed the global variable --- fedn/common/config.py | 3 --- 1 file changed, 3 deletions(-) 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) From 8821ae22eeb35540acce59875d3aaaf3aab0284b Mon Sep 17 00:00:00 2001 From: sowmyasri Date: Thu, 4 Jul 2024 11:23:11 +0200 Subject: [PATCH 6/6] removed raise in the round handler --- fedn/network/combiner/roundhandler.py | 1 - 1 file changed, 1 deletion(-) 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):