Skip to content

Commit a8c5499

Browse files
committed
refactor: dynamically set USER_AGENT version using importlib.metadata.
1 parent c519d54 commit a8c5499

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

amazon_creatorsapi/aio/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import json
99
from dataclasses import dataclass
10+
from importlib.metadata import version
1011
from typing import TYPE_CHECKING, Any
1112

1213
from typing_extensions import Self
@@ -26,7 +27,8 @@
2627

2728
DEFAULT_HOST = "https://creatorsapi.amazon"
2829
DEFAULT_TIMEOUT = 30.0
29-
USER_AGENT = "python-amazon-paapi/6.0.0 (async)"
30+
VERSION = version("python-amazon-paapi")
31+
USER_AGENT = f"python-amazon-paapi/{VERSION} (async)"
3032

3133

3234
@dataclass

0 commit comments

Comments
 (0)