From 7ae258ebcadc4784c4871dfad3e15fca2d004609 Mon Sep 17 00:00:00 2001 From: "Aliaksei Yaletski (Tiendil)" Date: Sat, 28 Feb 2026 13:19:32 +0100 Subject: [PATCH] gh-62 Added `donna version` command that prints the version of the tool. --- .gitignore | 3 ++- changes/unreleased.md | 2 +- donna/cli/__main__.py | 1 + donna/cli/commands/version.py | 10 ++++++++++ 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 donna/cli/commands/version.py diff --git a/.gitignore b/.gitignore index 878403d9..db9b47db 100644 --- a/.gitignore +++ b/.gitignore @@ -207,4 +207,5 @@ __marimo__/ *~ .venv-donna -# .donna/session/ commented to easier navigate artifacts \ No newline at end of file +# .donna/session/ commented to easier navigate artifacts +.donna/tmp \ No newline at end of file diff --git a/changes/unreleased.md b/changes/unreleased.md index 373eb997..ad783e19 100644 --- a/changes/unreleased.md +++ b/changes/unreleased.md @@ -1,2 +1,2 @@ -No changes. +- gh-62 Added `donna version` command that prints the version of the tool. diff --git a/donna/cli/__main__.py b/donna/cli/__main__.py index 07c44647..414fdb6b 100644 --- a/donna/cli/__main__.py +++ b/donna/cli/__main__.py @@ -2,6 +2,7 @@ from donna.cli.commands import artifacts # noqa: F401 from donna.cli.commands import journal # noqa: F401 from donna.cli.commands import sessions # noqa: F401 +from donna.cli.commands import version # noqa: F401 from donna.cli.commands import workspaces # noqa: F401 app() diff --git a/donna/cli/commands/version.py b/donna/cli/commands/version.py new file mode 100644 index 00000000..a276ca07 --- /dev/null +++ b/donna/cli/commands/version.py @@ -0,0 +1,10 @@ +import importlib.metadata + +import typer + +from donna.cli.application import app + + +@app.command(help="Print the current Donna package version.") +def version() -> None: + typer.echo(importlib.metadata.version("donna"))