wavespeed 1.0.4__tar.gz → 1.0.6__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-1.0.4 → wavespeed-1.0.6}/PKG-INFO +1 -1
  2. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/_version.py +1 -1
  3. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/api/client.py +9 -0
  4. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/modules/scaler.py +22 -3
  5. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed.egg-info/PKG-INFO +1 -1
  6. {wavespeed-1.0.4 → wavespeed-1.0.6}/.github/workflows/claude-code-review.yml +0 -0
  7. {wavespeed-1.0.4 → wavespeed-1.0.6}/.github/workflows/claude.yml +0 -0
  8. {wavespeed-1.0.4 → wavespeed-1.0.6}/.github/workflows/pre-commit.yml +0 -0
  9. {wavespeed-1.0.4 → wavespeed-1.0.6}/.github/workflows/python-packages.yml +0 -0
  10. {wavespeed-1.0.4 → wavespeed-1.0.6}/.github/workflows/python-publish.yml +0 -0
  11. {wavespeed-1.0.4 → wavespeed-1.0.6}/.gitignore +0 -0
  12. {wavespeed-1.0.4 → wavespeed-1.0.6}/.pre-commit-config.yaml +0 -0
  13. {wavespeed-1.0.4 → wavespeed-1.0.6}/CLAUDE.md +0 -0
  14. {wavespeed-1.0.4 → wavespeed-1.0.6}/LICENSE +0 -0
  15. {wavespeed-1.0.4 → wavespeed-1.0.6}/MANIFEST.in +0 -0
  16. {wavespeed-1.0.4 → wavespeed-1.0.6}/README.md +0 -0
  17. {wavespeed-1.0.4 → wavespeed-1.0.6}/VERSIONING.md +0 -0
  18. {wavespeed-1.0.4 → wavespeed-1.0.6}/images/build_and_push.sh +0 -0
  19. {wavespeed-1.0.4 → wavespeed-1.0.6}/images/test_worker/Dockerfile +0 -0
  20. {wavespeed-1.0.4 → wavespeed-1.0.6}/images/test_worker/build_and_test.sh +0 -0
  21. {wavespeed-1.0.4 → wavespeed-1.0.6}/images/test_worker/handler.py +0 -0
  22. {wavespeed-1.0.4 → wavespeed-1.0.6}/images/test_worker/requirements.txt +0 -0
  23. {wavespeed-1.0.4 → wavespeed-1.0.6}/images/test_worker/test_input.json +0 -0
  24. {wavespeed-1.0.4 → wavespeed-1.0.6}/pyproject.toml +0 -0
  25. {wavespeed-1.0.4 → wavespeed-1.0.6}/pytest.ini +0 -0
  26. {wavespeed-1.0.4 → wavespeed-1.0.6}/setup.cfg +0 -0
  27. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/__init__.py +0 -0
  28. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/_config_module.py +0 -0
  29. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/api/__init__.py +0 -0
  30. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/config.py +0 -0
  31. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/__init__.py +0 -0
  32. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/modules/__init__.py +0 -0
  33. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/modules/fastapi.py +0 -0
  34. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/modules/handler.py +0 -0
  35. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/modules/heartbeat.py +0 -0
  36. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/modules/http.py +0 -0
  37. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/modules/job.py +0 -0
  38. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/modules/local.py +0 -0
  39. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/modules/logger.py +0 -0
  40. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/modules/progress.py +0 -0
  41. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/modules/state.py +0 -0
  42. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/utils/__init__.py +0 -0
  43. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/utils/boto3_utils.py +0 -0
  44. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/utils/validator.py +0 -0
  45. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed/serverless/worker.py +0 -0
  46. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed.egg-info/SOURCES.txt +0 -0
  47. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed.egg-info/dependency_links.txt +0 -0
  48. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed.egg-info/not-zip-safe +0 -0
  49. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed.egg-info/requires.txt +0 -0
  50. {wavespeed-1.0.4 → wavespeed-1.0.6}/src/wavespeed.egg-info/top_level.txt +0 -0
  51. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/__init__.py +0 -0
  52. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/conftest.py +0 -0
  53. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_api.py +0 -0
  54. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_config.py +0 -0
  55. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/__init__.py +0 -0
  56. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/test_modules/__init__.py +0 -0
  57. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/test_modules/test_fastapi.py +0 -0
  58. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/test_modules/test_handler.py +0 -0
  59. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/test_modules/test_http.py +0 -0
  60. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/test_modules/test_job.py +0 -0
  61. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/test_modules/test_local.py +0 -0
  62. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/test_modules/test_logger.py +0 -0
  63. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/test_modules/test_progress.py +0 -0
  64. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/test_modules/test_scaler.py +0 -0
  65. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/test_modules/test_state.py +0 -0
  66. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/test_utils/__init__.py +0 -0
  67. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/test_utils/test_validator.py +0 -0
  68. {wavespeed-1.0.4 → wavespeed-1.0.6}/tests/test_serverless/test_worker.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wavespeed
3
- Version: 1.0.4
3
+ Version: 1.0.6
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
@@ -1,2 +1,2 @@
1
1
  # This file is automatically generated by setuptools_scm
2
- __version__ = "1.0.4"
2
+ __version__ = "1.0.6"
@@ -312,6 +312,15 @@ class Client:
312
312
 
313
313
  if enable_sync_mode:
314
314
  # In sync mode, extract outputs from the result
315
+ status = sync_result.get("data", {}).get("status")
316
+ if status != "completed":
317
+ error = (
318
+ sync_result.get("data", {}).get("error") or "Unknown error"
319
+ )
320
+ request_id = sync_result.get("data", {}).get("id", "unknown")
321
+ raise RuntimeError(
322
+ f"Prediction failed (task_id: {request_id}): {error}"
323
+ )
315
324
  data = sync_result.get("data", {})
316
325
  return {"outputs": data.get("outputs", [])}
317
326
 
@@ -62,6 +62,12 @@ class JobScaler:
62
62
  if concurrency_modifier := config.get("concurrency_modifier"):
63
63
  self.concurrency_modifier = concurrency_modifier
64
64
 
65
+ # Apply concurrency modifier immediately
66
+ old_concurrency = self.current_concurrency
67
+ self.current_concurrency = self.concurrency_modifier(self.current_concurrency)
68
+ if self.current_concurrency != old_concurrency:
69
+ self.jobs_queue = asyncio.Queue(maxsize=self.current_concurrency)
70
+
65
71
  # Allow overriding jobs_fetcher and handler in local test mode
66
72
  if not IS_LOCAL_TEST:
67
73
  return
@@ -207,20 +213,33 @@ class JobScaler:
207
213
  tasks: list[asyncio.Task[None]] = []
208
214
 
209
215
  while self.is_alive() or not self.jobs_queue.empty():
216
+ num_tasks = len(tasks)
217
+
210
218
  while len(tasks) < self.current_concurrency and not self.jobs_queue.empty():
211
219
  job = await self.jobs_queue.get()
212
220
  task = asyncio.create_task(self.handle_job(session, job))
213
221
  tasks.append(task)
214
222
 
215
- if tasks:
216
- log.info(f"Jobs in progress: {len(tasks)}")
223
+ if len(tasks) > num_tasks:
224
+ log.info(
225
+ f"Started {len(tasks) - num_tasks} new job(s), "
226
+ f"total jobs in progress: {len(tasks)}"
227
+ )
217
228
 
229
+ if tasks:
218
230
  done, pending = await asyncio.wait(
219
- tasks, return_when=asyncio.FIRST_COMPLETED
231
+ tasks, timeout=0.1, return_when=asyncio.FIRST_COMPLETED
220
232
  )
221
233
 
234
+ num_tasks = len(tasks)
222
235
  tasks = [t for t in tasks if t not in done]
223
236
 
237
+ if len(tasks) < num_tasks:
238
+ log.info(
239
+ f"Completed {num_tasks - len(tasks)} job(s), "
240
+ f"total jobs in progress: {len(tasks)}"
241
+ )
242
+
224
243
  await asyncio.sleep(0)
225
244
 
226
245
  await asyncio.gather(*tasks)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wavespeed
3
- Version: 1.0.4
3
+ Version: 1.0.6
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
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
File without changes
File without changes