wavespeed 0.1.2__tar.gz → 1.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. {wavespeed-0.1.2 → wavespeed-1.0.3}/PKG-INFO +5 -5
  2. {wavespeed-0.1.2 → wavespeed-1.0.3}/README.md +4 -4
  3. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/__init__.py +1 -1
  4. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/_version.py +1 -1
  5. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/api/__init__.py +5 -5
  6. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/api/client.py +3 -3
  7. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/modules/logger.py +4 -2
  8. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed.egg-info/PKG-INFO +5 -5
  9. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_api.py +5 -7
  10. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/test_modules/test_http.py +3 -0
  11. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/test_modules/test_scaler.py +2 -2
  12. {wavespeed-0.1.2 → wavespeed-1.0.3}/.github/workflows/claude-code-review.yml +0 -0
  13. {wavespeed-0.1.2 → wavespeed-1.0.3}/.github/workflows/claude.yml +0 -0
  14. {wavespeed-0.1.2 → wavespeed-1.0.3}/.github/workflows/pre-commit.yml +0 -0
  15. {wavespeed-0.1.2 → wavespeed-1.0.3}/.github/workflows/python-packages.yml +0 -0
  16. {wavespeed-0.1.2 → wavespeed-1.0.3}/.github/workflows/python-publish.yml +0 -0
  17. {wavespeed-0.1.2 → wavespeed-1.0.3}/.gitignore +0 -0
  18. {wavespeed-0.1.2 → wavespeed-1.0.3}/.pre-commit-config.yaml +0 -0
  19. {wavespeed-0.1.2 → wavespeed-1.0.3}/CLAUDE.md +0 -0
  20. {wavespeed-0.1.2 → wavespeed-1.0.3}/LICENSE +0 -0
  21. {wavespeed-0.1.2 → wavespeed-1.0.3}/MANIFEST.in +0 -0
  22. {wavespeed-0.1.2 → wavespeed-1.0.3}/VERSIONING.md +0 -0
  23. {wavespeed-0.1.2 → wavespeed-1.0.3}/images/build_and_push.sh +0 -0
  24. {wavespeed-0.1.2 → wavespeed-1.0.3}/images/test_worker/Dockerfile +0 -0
  25. {wavespeed-0.1.2 → wavespeed-1.0.3}/images/test_worker/build_and_test.sh +0 -0
  26. {wavespeed-0.1.2 → wavespeed-1.0.3}/images/test_worker/handler.py +0 -0
  27. {wavespeed-0.1.2 → wavespeed-1.0.3}/images/test_worker/requirements.txt +0 -0
  28. {wavespeed-0.1.2 → wavespeed-1.0.3}/images/test_worker/test_input.json +0 -0
  29. {wavespeed-0.1.2 → wavespeed-1.0.3}/pyproject.toml +0 -0
  30. {wavespeed-0.1.2 → wavespeed-1.0.3}/pytest.ini +0 -0
  31. {wavespeed-0.1.2 → wavespeed-1.0.3}/setup.cfg +0 -0
  32. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/_config_module.py +0 -0
  33. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/config.py +0 -0
  34. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/__init__.py +0 -0
  35. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/modules/__init__.py +0 -0
  36. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/modules/fastapi.py +0 -0
  37. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/modules/handler.py +0 -0
  38. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/modules/heartbeat.py +0 -0
  39. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/modules/http.py +0 -0
  40. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/modules/job.py +0 -0
  41. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/modules/local.py +0 -0
  42. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/modules/progress.py +0 -0
  43. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/modules/scaler.py +0 -0
  44. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/modules/state.py +0 -0
  45. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/utils/__init__.py +0 -0
  46. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/utils/boto3_utils.py +0 -0
  47. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/utils/validator.py +0 -0
  48. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed/serverless/worker.py +0 -0
  49. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed.egg-info/SOURCES.txt +0 -0
  50. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed.egg-info/dependency_links.txt +0 -0
  51. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed.egg-info/not-zip-safe +0 -0
  52. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed.egg-info/requires.txt +0 -0
  53. {wavespeed-0.1.2 → wavespeed-1.0.3}/src/wavespeed.egg-info/top_level.txt +0 -0
  54. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/__init__.py +0 -0
  55. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/conftest.py +0 -0
  56. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_config.py +0 -0
  57. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/__init__.py +0 -0
  58. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/test_modules/__init__.py +0 -0
  59. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/test_modules/test_fastapi.py +0 -0
  60. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/test_modules/test_handler.py +0 -0
  61. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/test_modules/test_job.py +0 -0
  62. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/test_modules/test_local.py +0 -0
  63. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/test_modules/test_logger.py +0 -0
  64. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/test_modules/test_progress.py +0 -0
  65. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/test_modules/test_state.py +0 -0
  66. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/test_utils/__init__.py +0 -0
  67. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/test_utils/test_validator.py +0 -0
  68. {wavespeed-0.1.2 → wavespeed-1.0.3}/tests/test_serverless/test_worker.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wavespeed
3
- Version: 0.1.2
3
+ Version: 1.0.3
4
4
  Summary: WaveSpeedAI Python Client — Official Python SDK for WaveSpeedAI inference platform
5
5
  Author-email: WaveSpeedAI <support@wavespeed.ai>
6
6
  License: MIT
@@ -62,7 +62,7 @@ import wavespeed
62
62
 
63
63
  output = wavespeed.run(
64
64
  "wavespeed-ai/z-image/turbo",
65
- input={"prompt": "Cat"},
65
+ {"prompt": "Cat"},
66
66
  )
67
67
 
68
68
  print(output["outputs"][0]) # Output URL
@@ -82,7 +82,7 @@ Or pass it directly:
82
82
  from wavespeed import Client
83
83
 
84
84
  client = Client(api_key="your-api-key")
85
- output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"})
85
+ output = client.run("wavespeed-ai/z-image/turbo", {"prompt": "Cat"})
86
86
  ```
87
87
 
88
88
  ### Options
@@ -90,7 +90,7 @@ output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"})
90
90
  ```python
91
91
  output = wavespeed.run(
92
92
  "wavespeed-ai/z-image/turbo",
93
- input={"prompt": "Cat"},
93
+ {"prompt": "Cat"},
94
94
  timeout=36000.0, # Max wait time in seconds (default: 36000.0)
95
95
  poll_interval=1.0, # Status check interval (default: 1.0)
96
96
  enable_sync_mode=False, # Single request mode, no polling (default: False)
@@ -106,7 +106,7 @@ Use `enable_sync_mode=True` for a single request that waits for the result (no p
106
106
  ```python
107
107
  output = wavespeed.run(
108
108
  "wavespeed-ai/z-image/turbo",
109
- input={"prompt": "Cat"},
109
+ {"prompt": "Cat"},
110
110
  enable_sync_mode=True,
111
111
  )
112
112
  ```
@@ -33,7 +33,7 @@ import wavespeed
33
33
 
34
34
  output = wavespeed.run(
35
35
  "wavespeed-ai/z-image/turbo",
36
- input={"prompt": "Cat"},
36
+ {"prompt": "Cat"},
37
37
  )
38
38
 
39
39
  print(output["outputs"][0]) # Output URL
@@ -53,7 +53,7 @@ Or pass it directly:
53
53
  from wavespeed import Client
54
54
 
55
55
  client = Client(api_key="your-api-key")
56
- output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"})
56
+ output = client.run("wavespeed-ai/z-image/turbo", {"prompt": "Cat"})
57
57
  ```
58
58
 
59
59
  ### Options
@@ -61,7 +61,7 @@ output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"})
61
61
  ```python
62
62
  output = wavespeed.run(
63
63
  "wavespeed-ai/z-image/turbo",
64
- input={"prompt": "Cat"},
64
+ {"prompt": "Cat"},
65
65
  timeout=36000.0, # Max wait time in seconds (default: 36000.0)
66
66
  poll_interval=1.0, # Status check interval (default: 1.0)
67
67
  enable_sync_mode=False, # Single request mode, no polling (default: False)
@@ -77,7 +77,7 @@ Use `enable_sync_mode=True` for a single request that waits for the result (no p
77
77
  ```python
78
78
  output = wavespeed.run(
79
79
  "wavespeed-ai/z-image/turbo",
80
- input={"prompt": "Cat"},
80
+ {"prompt": "Cat"},
81
81
  enable_sync_mode=True,
82
82
  )
83
83
  ```
@@ -10,7 +10,7 @@ Example usage:
10
10
 
11
11
  output = wavespeed.run(
12
12
  "wavespeed-ai/z-image/turbo",
13
- input={"prompt": "A beautiful sunset"}
13
+ {"prompt": "A beautiful sunset"}
14
14
  )
15
15
  print(output["outputs"][0])
16
16
  """
@@ -1,2 +1,2 @@
1
1
  # This file is automatically generated by setuptools_scm
2
- __version__ = "0.1.2"
2
+ __version__ = "1.0.3"
@@ -7,7 +7,7 @@ Example usage:
7
7
 
8
8
  output = wavespeed.run(
9
9
  "wavespeed-ai/z-image/turbo",
10
- input={"prompt": "A beautiful sunset over mountains"}
10
+ {"prompt": "A beautiful sunset over mountains"}
11
11
  )
12
12
 
13
13
  print(output["outputs"][0]) # First output URL
@@ -65,27 +65,27 @@ def run(
65
65
  Example:
66
66
  output = wavespeed.run(
67
67
  "wavespeed-ai/z-image/turbo",
68
- input={"prompt": "A cat sitting on a windowsill"}
68
+ {"prompt": "A cat sitting on a windowsill"}
69
69
  )
70
70
  print(output["outputs"][0]) # First output URL
71
71
 
72
72
  # With sync mode
73
73
  output = wavespeed.run(
74
74
  "wavespeed-ai/z-image/turbo",
75
- input={"prompt": "A cat"},
75
+ {"prompt": "A cat"},
76
76
  enable_sync_mode=True
77
77
  )
78
78
 
79
79
  # With retry
80
80
  output = wavespeed.run(
81
81
  "wavespeed-ai/z-image/turbo",
82
- input={"prompt": "A cat"},
82
+ {"prompt": "A cat"},
83
83
  max_retries=3
84
84
  )
85
85
  """
86
86
  return _get_default_client().run(
87
87
  model,
88
- input=input,
88
+ input,
89
89
  timeout=timeout,
90
90
  poll_interval=poll_interval,
91
91
  enable_sync_mode=enable_sync_mode,
@@ -23,13 +23,13 @@ class Client:
23
23
 
24
24
  Example:
25
25
  client = Client(api_key="your-api-key")
26
- output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"})
26
+ output = client.run("wavespeed-ai/z-image/turbo", {"prompt": "Cat"})
27
27
 
28
28
  # With sync mode (single request, waits for result)
29
- output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"}, enable_sync_mode=True)
29
+ output = client.run("wavespeed-ai/z-image/turbo", {"prompt": "Cat"}, enable_sync_mode=True)
30
30
 
31
31
  # With retry
32
- output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"}, max_retries=3)
32
+ output = client.run("wavespeed-ai/z-image/turbo", {"prompt": "Cat"}, max_retries=3)
33
33
  """
34
34
 
35
35
  def __init__(
@@ -2,7 +2,7 @@
2
2
 
3
3
  import json
4
4
  import sys
5
- from datetime import datetime
5
+ from datetime import datetime, timezone
6
6
  from enum import IntEnum
7
7
  from typing import Optional
8
8
 
@@ -113,7 +113,9 @@ class WaverlessLogger:
113
113
  "requestId": job_id or "N/A",
114
114
  "message": message,
115
115
  "level": level.name,
116
- "timestamp": datetime.utcnow().isoformat() + "Z",
116
+ "timestamp": datetime.now(timezone.utc)
117
+ .isoformat()
118
+ .replace("+00:00", "Z"),
117
119
  }
118
120
  return json.dumps(log_data)
119
121
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wavespeed
3
- Version: 0.1.2
3
+ Version: 1.0.3
4
4
  Summary: WaveSpeedAI Python Client — Official Python SDK for WaveSpeedAI inference platform
5
5
  Author-email: WaveSpeedAI <support@wavespeed.ai>
6
6
  License: MIT
@@ -62,7 +62,7 @@ import wavespeed
62
62
 
63
63
  output = wavespeed.run(
64
64
  "wavespeed-ai/z-image/turbo",
65
- input={"prompt": "Cat"},
65
+ {"prompt": "Cat"},
66
66
  )
67
67
 
68
68
  print(output["outputs"][0]) # Output URL
@@ -82,7 +82,7 @@ Or pass it directly:
82
82
  from wavespeed import Client
83
83
 
84
84
  client = Client(api_key="your-api-key")
85
- output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"})
85
+ output = client.run("wavespeed-ai/z-image/turbo", {"prompt": "Cat"})
86
86
  ```
87
87
 
88
88
  ### Options
@@ -90,7 +90,7 @@ output = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "Cat"})
90
90
  ```python
91
91
  output = wavespeed.run(
92
92
  "wavespeed-ai/z-image/turbo",
93
- input={"prompt": "Cat"},
93
+ {"prompt": "Cat"},
94
94
  timeout=36000.0, # Max wait time in seconds (default: 36000.0)
95
95
  poll_interval=1.0, # Status check interval (default: 1.0)
96
96
  enable_sync_mode=False, # Single request mode, no polling (default: False)
@@ -106,7 +106,7 @@ Use `enable_sync_mode=True` for a single request that waits for the result (no p
106
106
  ```python
107
107
  output = wavespeed.run(
108
108
  "wavespeed-ai/z-image/turbo",
109
- input={"prompt": "Cat"},
109
+ {"prompt": "Cat"},
110
110
  enable_sync_mode=True,
111
111
  )
112
112
  ```
@@ -118,7 +118,7 @@ class TestClient(unittest.TestCase):
118
118
  mock_get.return_value = mock_get_response
119
119
 
120
120
  client = Client(api_key="test-key")
121
- result = client.run("wavespeed-ai/z-image/turbo", input={"prompt": "test"})
121
+ result = client.run("wavespeed-ai/z-image/turbo", {"prompt": "test"})
122
122
 
123
123
  self.assertEqual(result["outputs"], ["https://example.com/out.png"])
124
124
 
@@ -142,7 +142,7 @@ class TestClient(unittest.TestCase):
142
142
 
143
143
  client = Client(api_key="test-key")
144
144
  with self.assertRaises(RuntimeError) as ctx:
145
- client.run("wavespeed-ai/z-image/turbo", input={"prompt": "test"})
145
+ client.run("wavespeed-ai/z-image/turbo", {"prompt": "test"})
146
146
  self.assertIn("Model error", str(ctx.exception))
147
147
 
148
148
  @patch("wavespeed.api.client.time.time")
@@ -168,9 +168,7 @@ class TestClient(unittest.TestCase):
168
168
 
169
169
  client = Client(api_key="test-key")
170
170
  with self.assertRaises(TimeoutError) as ctx:
171
- client.run(
172
- "wavespeed-ai/z-image/turbo", input={"prompt": "test"}, timeout=10
173
- )
171
+ client.run("wavespeed-ai/z-image/turbo", {"prompt": "test"}, timeout=10)
174
172
  self.assertIn("timed out", str(ctx.exception))
175
173
 
176
174
 
@@ -208,7 +206,7 @@ class TestModuleLevelRun(unittest.TestCase):
208
206
  }
209
207
  mock_get.return_value = mock_get_response
210
208
 
211
- result = wavespeed.run("wavespeed-ai/z-image/turbo", input={"prompt": "test"})
209
+ result = wavespeed.run("wavespeed-ai/z-image/turbo", {"prompt": "test"})
212
210
  self.assertEqual(result["outputs"], ["https://example.com/out.png"])
213
211
 
214
212
 
@@ -342,7 +340,7 @@ class TestRealAPI(unittest.TestCase):
342
340
 
343
341
  output = wavespeed.run(
344
342
  "wavespeed-ai/z-image/turbo",
345
- input={"prompt": "A simple red circle on white background"},
343
+ {"prompt": "A simple red circle on white background"},
346
344
  )
347
345
 
348
346
  self.assertIn("outputs", output)
@@ -132,6 +132,7 @@ class TestFetchJobs(IsolatedAsyncioTestCase):
132
132
  mock_response.content_type = "application/json"
133
133
  mock_response.content_length = 100
134
134
  mock_response.json = AsyncMock(return_value={"id": "job_1", "input": {"n": 1}})
135
+ mock_response.raise_for_status = MagicMock()
135
136
  mock_response.__aenter__.return_value = mock_response
136
137
  mock_response.__aexit__.return_value = None
137
138
 
@@ -163,6 +164,7 @@ class TestFetchJobs(IsolatedAsyncioTestCase):
163
164
  {"id": "job_2", "input": {"n": 2}},
164
165
  ]
165
166
  )
167
+ mock_response.raise_for_status = MagicMock()
166
168
  mock_response.__aenter__.return_value = mock_response
167
169
  mock_response.__aexit__.return_value = None
168
170
 
@@ -287,6 +289,7 @@ class TestFetchJobs(IsolatedAsyncioTestCase):
287
289
  mock_response.content_type = "application/json"
288
290
  mock_response.content_length = 10
289
291
  mock_response.json = AsyncMock(return_value=[])
292
+ mock_response.raise_for_status = MagicMock()
290
293
  mock_response.__aenter__.return_value = mock_response
291
294
  mock_response.__aexit__.return_value = None
292
295
 
@@ -108,7 +108,7 @@ class TestJobScalerAsync(IsolatedAsyncioTestCase):
108
108
 
109
109
  scaler = JobScaler(config)
110
110
  scaler.job_progress = mock_progress_instance
111
- scaler.jobs_queue = AsyncMock()
111
+ scaler.jobs_queue = MagicMock()
112
112
 
113
113
  # Override the jobs_handler directly since __init__ already captured handle_job
114
114
  mock_handle = AsyncMock()
@@ -132,7 +132,7 @@ class TestJobScalerAsync(IsolatedAsyncioTestCase):
132
132
 
133
133
  scaler = JobScaler(config)
134
134
  scaler.job_progress = mock_progress_instance
135
- scaler.jobs_queue = AsyncMock()
135
+ scaler.jobs_queue = MagicMock()
136
136
 
137
137
  # Override the jobs_handler directly since __init__ already captured handle_job
138
138
  mock_handle = AsyncMock()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes