diff --git a/.gitignore b/.gitignore index 878403d..db9b47d 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 373eb99..ad783e1 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 07c4464..414fdb6 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 0000000..a276ca0 --- /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"))