From a179b15080fb3520b2c67f5016c04a1ba6bfd2c9 Mon Sep 17 00:00:00 2001 From: spicy-sauce Date: Tue, 24 Dec 2024 08:47:46 +0200 Subject: [PATCH] docstring --- cli/src/datayoga/__main__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cli/src/datayoga/__main__.py b/cli/src/datayoga/__main__.py index 3da77da4..2ede7060 100644 --- a/cli/src/datayoga/__main__.py +++ b/cli/src/datayoga/__main__.py @@ -33,7 +33,15 @@ def get_dy_distribution() -> str: - # support python 3.7 and up. pkg_resources has changed in newer versions + """Get the installed version of datayoga package. + + Attempts to retrieve version using importlib.metadata (Python 3.8+), + falling back to pkg_resources for earlier versions. Returns '0.0.0' + if the package is not found. + + Returns: + str: The version string of datayoga package, or '0.0.0' if not found. + """ try: from importlib import metadata return metadata.version("datayoga")