Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/SK-918 | Add --version to fedn CLI #649

Merged
merged 6 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions fedn/cli/main.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import importlib.metadata

import click

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:
"""
""":param ctx:"""
ctx.obj = dict()
3 changes: 0 additions & 3 deletions fedn/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion fedn/network/combiner/roundhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading