Skip to content

Commit 248214a

Browse files
Export __version__ via __all__
PEP 396 convention: ``__version__`` is the canonical public module-level version handle. Add it to ``__all__`` so ``from dqlitewire import *`` binds it and static-analysis tools that treat ``__all__`` as the source of truth see it as public — matching python-dqlite-dbapi which already advertises it this way. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 872055e commit 248214a

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/dqlitewire/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969

7070
__all__ = [
7171
"ContinuationError",
72+
"__version__",
7273
"DecodeError",
7374
"EncodeError",
7475
"HandshakeError",

tests/test_version.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,14 @@ def test_pyproject_matches_package_version() -> None:
1111
with pyproject.open("rb") as f:
1212
metadata = tomllib.load(f)
1313
assert metadata["project"]["version"] == dqlitewire.__version__
14+
15+
16+
def test_version_is_in_all() -> None:
17+
"""Pin ``__version__`` as a public, re-exported attribute.
18+
19+
PEP 396 convention: ``__version__`` is the canonical module-level
20+
handle for version discovery and belongs in ``__all__`` so
21+
``from dqlitewire import *`` binds it and static-analysis tools
22+
that read ``__all__`` as the source of truth see it as public.
23+
"""
24+
assert "__version__" in dqlitewire.__all__

0 commit comments

Comments
 (0)