Skip to content

Commit 2b9809c

Browse files
committed
feat: add version
1 parent f39c6ce commit 2b9809c

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/emd/cli.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@
7474
name="config",
7575
help="Set default config",
7676
)
77-
# app.add_typer(
78-
# version.app,
79-
# name="version",
80-
# help="Show version",
81-
# )
77+
78+
app.add_typer(
79+
version.app,
80+
name="version",
81+
help="Show version",
82+
)
83+
8284
@app.command(help="List supported models")
8385
@catch_aws_credential_errors
8486
def list_supported_models(model_id: Annotated[
@@ -105,6 +107,9 @@ def callback(ctx: typer.Context):
105107
)
106108
# Show main help
107109
console.print(ctx.get_help())
110+
console.print(
111+
" [dim]Further help: [link=https://github.com/aws-samples/easy-model-deployer/]https://github.com/aws-samples/easy-model-deployer/[/link][/dim]",
112+
)
108113

109114
if __name__ == "__main__":
110115
bootstrap.bootstrap()

src/emd/commands/version.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from emd.revision import VERSION
1+
from emd.revision import VERSION, COMMIT_HASH
22
import typer
3-
from emd.utils.decorators import load_aws_profile, catch_aws_credential_errors, check_emd_env_exist
43
from emd.utils.logger_utils import make_layout
54

65
app = typer.Typer(pretty_exceptions_enable=False)
@@ -9,8 +8,5 @@
98

109
#@app.callback(invoke_without_command=True)(invoke_without_command=True)
1110
@app.callback(invoke_without_command=True)
12-
@catch_aws_credential_errors
13-
@check_emd_env_exist
14-
@load_aws_profile
1511
def version():
16-
print(VERSION)
12+
print(f"emd {VERSION} (build {COMMIT_HASH})")

0 commit comments

Comments
 (0)