Skip to content

Commit

Permalink
docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
spicy-sauce committed Dec 24, 2024
1 parent 0f50f02 commit a179b15
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cli/src/datayoga/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit a179b15

Please sign in to comment.