Skip to content

Commit b3385e3

Browse files
chore: update SDK to v0.4.1
1 parent 38380bc commit b3385e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+7769
-7768
lines changed

conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
project = "X API SDK"
2222
copyright = "2024, X Developer Platform"
2323
author = "X Developer Platform"
24-
release = "0.4.0"
25-
version = "0.4.0"
24+
release = "0.4.1"
25+
version = "0.4.1"
2626

2727
# -- General configuration ----------------------------------------------------
2828

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build-backend = "hatchling.build"
1414

1515
[project]
1616
name = "xdk"
17-
version = "0.4.0"
17+
version = "0.4.1"
1818
description = "Python SDK for the X API"
1919
authors = [
2020
{name = "X Developer Platform", email = "[email protected]"},

scripts/process-for-mintlify.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
MINTLIFY_CONFIG = {
2525
"outputDir": "mintlify-docs",
2626
"baseUrl": "https://docs.x.com",
27-
"title": "X API SDK v0.4.0",
27+
"title": "X API SDK v0.4.1",
2828
"description": "Python SDK for the X API with comprehensive pagination, authentication, and streaming support.",
29-
"version": "0.4.0",
29+
"version": "0.4.1",
3030
"githubUrl": "https://github.com/xdevplatform/xdk",
3131
}
3232

tests/account_activity/test_contracts.py

Lines changed: 130 additions & 130 deletions
Large diffs are not rendered by default.

tests/account_activity/test_structure.py

Lines changed: 76 additions & 76 deletions
Large diffs are not rendered by default.

tests/community_notes/test_contracts.py

Lines changed: 107 additions & 107 deletions
Large diffs are not rendered by default.

tests/community_notes/test_structure.py

Lines changed: 88 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,92 @@ def setup_class(self):
2828
self.community_notes_client = getattr(self.client, "community_notes")
2929

3030

31+
def test_evaluate_exists(self):
32+
"""Test that evaluate method exists with correct signature."""
33+
# Check method exists
34+
method = getattr(CommunityNotesClient, "evaluate", None)
35+
assert (
36+
method is not None
37+
), f"Method evaluate does not exist on CommunityNotesClient"
38+
# Check method is callable
39+
assert callable(method), f"evaluate is not callable"
40+
# Check method signature
41+
sig = inspect.signature(method)
42+
params = list(sig.parameters.keys())
43+
# Should have 'self' as first parameter
44+
assert len(params) >= 1, f"evaluate should have at least 'self' parameter"
45+
assert (
46+
params[0] == "self"
47+
), f"First parameter should be 'self', got '{params[0]}'"
48+
# Check required parameters exist (excluding 'self')
49+
required_params = []
50+
for required_param in required_params:
51+
assert (
52+
required_param in params
53+
), f"Required parameter '{required_param}' missing from evaluate"
54+
# Check optional parameters have defaults (excluding 'self')
55+
optional_params = []
56+
for optional_param in optional_params:
57+
if optional_param in params:
58+
param_obj = sig.parameters[optional_param]
59+
assert (
60+
param_obj.default is not inspect.Parameter.empty
61+
), f"Optional parameter '{optional_param}' should have a default value"
62+
63+
64+
def test_evaluate_return_annotation(self):
65+
"""Test that evaluate has proper return type annotation."""
66+
method = getattr(CommunityNotesClient, "evaluate")
67+
sig = inspect.signature(method)
68+
# Check return annotation exists
69+
assert (
70+
sig.return_annotation is not inspect.Signature.empty
71+
), f"Method evaluate should have return type annotation"
72+
73+
74+
def test_create_exists(self):
75+
"""Test that create method exists with correct signature."""
76+
# Check method exists
77+
method = getattr(CommunityNotesClient, "create", None)
78+
assert (
79+
method is not None
80+
), f"Method create does not exist on CommunityNotesClient"
81+
# Check method is callable
82+
assert callable(method), f"create is not callable"
83+
# Check method signature
84+
sig = inspect.signature(method)
85+
params = list(sig.parameters.keys())
86+
# Should have 'self' as first parameter
87+
assert len(params) >= 1, f"create should have at least 'self' parameter"
88+
assert (
89+
params[0] == "self"
90+
), f"First parameter should be 'self', got '{params[0]}'"
91+
# Check required parameters exist (excluding 'self')
92+
required_params = []
93+
for required_param in required_params:
94+
assert (
95+
required_param in params
96+
), f"Required parameter '{required_param}' missing from create"
97+
# Check optional parameters have defaults (excluding 'self')
98+
optional_params = []
99+
for optional_param in optional_params:
100+
if optional_param in params:
101+
param_obj = sig.parameters[optional_param]
102+
assert (
103+
param_obj.default is not inspect.Parameter.empty
104+
), f"Optional parameter '{optional_param}' should have a default value"
105+
106+
107+
def test_create_return_annotation(self):
108+
"""Test that create has proper return type annotation."""
109+
method = getattr(CommunityNotesClient, "create")
110+
sig = inspect.signature(method)
111+
# Check return annotation exists
112+
assert (
113+
sig.return_annotation is not inspect.Signature.empty
114+
), f"Method create should have return type annotation"
115+
116+
31117
def test_search_written_exists(self):
32118
"""Test that search_written method exists with correct signature."""
33119
# Check method exists
@@ -172,49 +258,6 @@ def test_search_eligible_posts_pagination_params(self):
172258
), f"Paginated method search_eligible_posts should have pagination parameters"
173259

174260

175-
def test_evaluate_exists(self):
176-
"""Test that evaluate method exists with correct signature."""
177-
# Check method exists
178-
method = getattr(CommunityNotesClient, "evaluate", None)
179-
assert (
180-
method is not None
181-
), f"Method evaluate does not exist on CommunityNotesClient"
182-
# Check method is callable
183-
assert callable(method), f"evaluate is not callable"
184-
# Check method signature
185-
sig = inspect.signature(method)
186-
params = list(sig.parameters.keys())
187-
# Should have 'self' as first parameter
188-
assert len(params) >= 1, f"evaluate should have at least 'self' parameter"
189-
assert (
190-
params[0] == "self"
191-
), f"First parameter should be 'self', got '{params[0]}'"
192-
# Check required parameters exist (excluding 'self')
193-
required_params = []
194-
for required_param in required_params:
195-
assert (
196-
required_param in params
197-
), f"Required parameter '{required_param}' missing from evaluate"
198-
# Check optional parameters have defaults (excluding 'self')
199-
optional_params = []
200-
for optional_param in optional_params:
201-
if optional_param in params:
202-
param_obj = sig.parameters[optional_param]
203-
assert (
204-
param_obj.default is not inspect.Parameter.empty
205-
), f"Optional parameter '{optional_param}' should have a default value"
206-
207-
208-
def test_evaluate_return_annotation(self):
209-
"""Test that evaluate has proper return type annotation."""
210-
method = getattr(CommunityNotesClient, "evaluate")
211-
sig = inspect.signature(method)
212-
# Check return annotation exists
213-
assert (
214-
sig.return_annotation is not inspect.Signature.empty
215-
), f"Method evaluate should have return type annotation"
216-
217-
218261
def test_delete_exists(self):
219262
"""Test that delete method exists with correct signature."""
220263
# Check method exists
@@ -260,57 +303,14 @@ def test_delete_return_annotation(self):
260303
), f"Method delete should have return type annotation"
261304

262305

263-
def test_create_exists(self):
264-
"""Test that create method exists with correct signature."""
265-
# Check method exists
266-
method = getattr(CommunityNotesClient, "create", None)
267-
assert (
268-
method is not None
269-
), f"Method create does not exist on CommunityNotesClient"
270-
# Check method is callable
271-
assert callable(method), f"create is not callable"
272-
# Check method signature
273-
sig = inspect.signature(method)
274-
params = list(sig.parameters.keys())
275-
# Should have 'self' as first parameter
276-
assert len(params) >= 1, f"create should have at least 'self' parameter"
277-
assert (
278-
params[0] == "self"
279-
), f"First parameter should be 'self', got '{params[0]}'"
280-
# Check required parameters exist (excluding 'self')
281-
required_params = []
282-
for required_param in required_params:
283-
assert (
284-
required_param in params
285-
), f"Required parameter '{required_param}' missing from create"
286-
# Check optional parameters have defaults (excluding 'self')
287-
optional_params = []
288-
for optional_param in optional_params:
289-
if optional_param in params:
290-
param_obj = sig.parameters[optional_param]
291-
assert (
292-
param_obj.default is not inspect.Parameter.empty
293-
), f"Optional parameter '{optional_param}' should have a default value"
294-
295-
296-
def test_create_return_annotation(self):
297-
"""Test that create has proper return type annotation."""
298-
method = getattr(CommunityNotesClient, "create")
299-
sig = inspect.signature(method)
300-
# Check return annotation exists
301-
assert (
302-
sig.return_annotation is not inspect.Signature.empty
303-
), f"Method create should have return type annotation"
304-
305-
306306
def test_all_expected_methods_exist(self):
307307
"""Test that all expected methods exist on the client."""
308308
expected_methods = [
309+
"evaluate",
310+
"create",
309311
"search_written",
310312
"search_eligible_posts",
311-
"evaluate",
312313
"delete",
313-
"create",
314314
]
315315
for expected_method in expected_methods:
316316
assert hasattr(

0 commit comments

Comments
 (0)