Skip to content

Commit 8f08252

Browse files
Iamrodosyaythomas
andauthored
feat: export __version__ from package root
- Re-export __version__ from __about__ module at package level - Add __version__ to __all__ for explicit public API declaration - Add test to verify __version__ is accessible Enables the standard Python version access pattern: import aws_durable_execution_sdk_python print(aws_durable_execution_sdk_python.__version__) This follows the convention used by boto3, botocore, and AWS Lambda Powertools, allowing users to access version information without knowledge of internal module structure. Co-authored-by: thomas <18520168+yaythomas@users.noreply.github.com>
1 parent af063e6 commit 8f08252

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/aws_durable_execution_sdk_python/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
"""AWS Lambda Durable Executions Python SDK."""
22

3+
# Package metadata
4+
from aws_durable_execution_sdk_python.__about__ import __version__
5+
36
# Main context - used in every durable function
47
# Helper decorators - commonly used for step functions
58
# Concurrency
@@ -31,6 +34,7 @@
3134
"InvocationError",
3235
"StepContext",
3336
"ValidationError",
37+
"__version__",
3438
"durable_execution",
3539
"durable_step",
3640
"durable_wait_for_callback",

tests/durable_executions_python_language_sdk_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,12 @@
44
def test_aws_durable_execution_sdk_python_importable():
55
"""Test aws_durable_execution_sdk_python is importable."""
66
import aws_durable_execution_sdk_python # noqa: PLC0415, F401
7+
8+
9+
def test_version_is_accessible():
10+
"""Test __version__ is accessible from package root."""
11+
import aws_durable_execution_sdk_python # noqa: PLC0415
12+
13+
assert hasattr(aws_durable_execution_sdk_python, "__version__")
14+
assert isinstance(aws_durable_execution_sdk_python.__version__, str)
15+
assert len(aws_durable_execution_sdk_python.__version__) > 0

0 commit comments

Comments
 (0)