Skip to content

Commit 1313df4

Browse files
feat(sdk): add X-SDK-Version and X-SDK-Language headers, bump to 1.1.2
- Created _version.py as single source of truth for version string - __init__.py and config.py both import from _version.py (no more drift) - Every API request now sends X-SDK-Version and X-SDK-Language headers - User-Agent reads from _version.py dynamically - Bumped all version references to 1.1.2 - Added test for SDK version headers Closes #2319
1 parent e400686 commit 1313df4

8 files changed

Lines changed: 18 additions & 7 deletions

File tree

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = validkit
3-
version = 1.1.1
3+
version = 1.1.2
44
author = ValidKit
55
author_email = support@validkit.com
66
description = Async Python SDK for ValidKit Email Verification API - Built for AI Agents

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name="validkit",
12-
version="1.1.1",
12+
version="1.1.2",
1313
author="ValidKit",
1414
author_email="support@validkit.com",
1515
description="Async Python SDK for ValidKit Email Verification API - Built for AI Agents",

setup_minimal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="validkit",
8-
version="1.1.1",
8+
version="1.1.2",
99
author="ValidKit",
1010
author_email="developers@validkit.com",
1111
description="Async Python SDK for ValidKit Email Verification API",

tests/test_config.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,9 @@ def test_defaults(self):
3939

4040
def test_user_agent_contains_version(self):
4141
config = ValidKitConfig(api_key="test")
42-
assert "1.1.1" in config.user_agent
42+
assert "1.1.2" in config.user_agent
43+
44+
def test_headers_include_sdk_version(self):
45+
config = ValidKitConfig(api_key="test")
46+
assert config.headers["X-SDK-Version"] == "1.1.2"
47+
assert config.headers["X-SDK-Language"] == "python"

tests/test_imports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_import_exceptions():
4848

4949
def test_version():
5050
from validkit import __version__
51-
assert __version__ == "1.1.1"
51+
assert __version__ == "1.1.2"
5252

5353

5454
def test_no_email_validator_required():

validkit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
ConnectionError
2626
)
2727

28-
__version__ = "1.1.1"
28+
from validkit._version import __version__ # noqa: E402
2929
__author__ = "ValidKit"
3030
__email__ = "support@validkit.com"
3131

validkit/_version.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""Single source of truth for the SDK version."""
2+
3+
__version__ = "1.1.2"

validkit/config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from typing import Optional, Dict, Any
44
from dataclasses import dataclass, field
5+
from validkit._version import __version__
56

67

78
@dataclass
@@ -18,7 +19,7 @@ class ValidKitConfig:
1819
rate_limit: Optional[int] = None # requests per minute
1920

2021
# Agent-specific settings
21-
user_agent: str = "ValidKit-Python/1.1.1"
22+
user_agent: str = f"ValidKit-Python/{__version__}"
2223
enable_compression: bool = True
2324
compact_format: bool = True # Use token-efficient format by default
2425

@@ -60,6 +61,8 @@ def headers(self) -> Dict[str, str]:
6061
headers = {
6162
"User-Agent": self.user_agent,
6263
"X-API-Key": self.api_key,
64+
"X-SDK-Version": __version__,
65+
"X-SDK-Language": "python",
6366
"Content-Type": "application/json",
6467
"Accept": "application/json",
6568
}

0 commit comments

Comments
 (0)