Skip to content

Commit 284add0

Browse files
Re-export __version__ from the async PEP 249 module
The sync dqlitedbapi module exposes __version__; the async variant did not, so dqlitedbapi.aio.__version__ raised AttributeError and the symbol was absent from aio.__all__. Pull the version string through a single source-of-truth import and list it in __all__, mirroring the sync module. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9c6cd55 commit 284add0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/dqlitedbapi/aio/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Async PEP 249-style interface for dqlite."""
22

3+
from dqlitedbapi import __version__
34
from dqlitedbapi.aio.connection import AsyncConnection
45
from dqlitedbapi.aio.cursor import AsyncCursor
56
from dqlitedbapi.exceptions import (
@@ -45,6 +46,7 @@
4546

4647
__all__ = [
4748
# Module attributes
49+
"__version__",
4850
"apilevel",
4951
"threadsafety",
5052
"paramstyle",

tests/test_version_export.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Test that __version__ is in __all__."""
22

33
import dqlitedbapi
4+
from dqlitedbapi import aio
45

56

67
class TestVersionExport:
@@ -9,3 +10,10 @@ def test_version_in_all(self) -> None:
910

1011
def test_version_is_string(self) -> None:
1112
assert isinstance(dqlitedbapi.__version__, str)
13+
14+
def test_aio_module_exports_version(self) -> None:
15+
assert hasattr(aio, "__version__")
16+
assert aio.__version__ == dqlitedbapi.__version__
17+
18+
def test_aio_version_in_all(self) -> None:
19+
assert "__version__" in aio.__all__

0 commit comments

Comments
 (0)