-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/SK-918 | Add --version to fedn CLI (#649)
* added --version command for fedn package * fixed single quotes with double quotes * fixed double quotes for version * intendation error fixed * fixed the global variable * removed raise in the round handler
- Loading branch information
1 parent
28631b7
commit 19e08c0
Showing
3 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters