Skip to content

Commit

Permalink
Add standard Python module __version__ attr (#3111)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-beedie committed Mar 22, 2024
1 parent f9e1b12 commit 3f817f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/python_api/src_py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@


def __getattr__(name: str) -> str | int:
if name == "version":
if name in ("version", "__version__"):
return Database.get_version()
elif name == "storage_version":
return Database.get_storage_version()
Expand All @@ -75,6 +75,7 @@ def __getattr__(name: str) -> str | int:
"PreparedStatement",
"QueryResult",
"Type",
"__version__",
"storage_version",
"version",
]
1 change: 1 addition & 0 deletions tools/python_api/test/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ def test_version() -> None:

assert kuzu.version != ""
assert kuzu.storage_version > 0
assert kuzu.version == kuzu.__version__

0 comments on commit 3f817f2

Please sign in to comment.