dbos 0.25.0a8__tar.gz → 0.25.0a9__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.

Potentially problematic release.


This version of dbos might be problematic. Click here for more details.

Files changed (99) hide show
  1. {dbos-0.25.0a8 → dbos-0.25.0a9}/PKG-INFO +2 -1
  2. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_core.py +4 -5
  3. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_dbos.py +3 -14
  4. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_queue.py +4 -4
  5. {dbos-0.25.0a8 → dbos-0.25.0a9}/pyproject.toml +3 -1
  6. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_classdecorators.py +1 -1
  7. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_fastapi.py +1 -1
  8. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_fastapi_roles.py +3 -1
  9. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_workflow_cancel.py +2 -2
  10. {dbos-0.25.0a8 → dbos-0.25.0a9}/LICENSE +0 -0
  11. {dbos-0.25.0a8 → dbos-0.25.0a9}/README.md +0 -0
  12. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/__init__.py +0 -0
  13. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/__main__.py +0 -0
  14. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_admin_server.py +0 -0
  15. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_app_db.py +0 -0
  16. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_classproperty.py +0 -0
  17. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_cloudutils/authentication.py +0 -0
  18. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_cloudutils/cloudutils.py +0 -0
  19. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_cloudutils/databases.py +0 -0
  20. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_conductor/conductor.py +0 -0
  21. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_conductor/protocol.py +0 -0
  22. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_context.py +0 -0
  23. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_croniter.py +0 -0
  24. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_db_wizard.py +0 -0
  25. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_dbos_config.py +0 -0
  26. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_debug.py +0 -0
  27. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_error.py +0 -0
  28. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_fastapi.py +0 -0
  29. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_flask.py +0 -0
  30. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_kafka.py +0 -0
  31. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_kafka_message.py +0 -0
  32. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_logger.py +0 -0
  33. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_migrations/env.py +0 -0
  34. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_migrations/script.py.mako +0 -0
  35. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_migrations/versions/04ca4f231047_workflow_queues_executor_id.py +0 -0
  36. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_migrations/versions/50f3227f0b4b_fix_job_queue.py +0 -0
  37. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_migrations/versions/5c361fc04708_added_system_tables.py +0 -0
  38. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_migrations/versions/a3b18ad34abe_added_triggers.py +0 -0
  39. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_migrations/versions/d76646551a6b_job_queue_limiter.py +0 -0
  40. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_migrations/versions/d76646551a6c_workflow_queue.py +0 -0
  41. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_migrations/versions/eab0cc1d9a14_job_queue.py +0 -0
  42. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_migrations/versions/f4b9b32ba814_functionname_childid_op_outputs.py +0 -0
  43. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_outcome.py +0 -0
  44. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_recovery.py +0 -0
  45. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_registrations.py +0 -0
  46. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_request.py +0 -0
  47. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_roles.py +0 -0
  48. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_scheduler.py +0 -0
  49. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_schemas/__init__.py +0 -0
  50. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_schemas/application_database.py +0 -0
  51. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_schemas/system_database.py +0 -0
  52. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_serialization.py +0 -0
  53. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_sys_db.py +0 -0
  54. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_templates/dbos-db-starter/README.md +0 -0
  55. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_templates/dbos-db-starter/__package/__init__.py +0 -0
  56. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_templates/dbos-db-starter/__package/main.py +0 -0
  57. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_templates/dbos-db-starter/__package/schema.py +0 -0
  58. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_templates/dbos-db-starter/alembic.ini +0 -0
  59. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_templates/dbos-db-starter/dbos-config.yaml.dbos +0 -0
  60. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_templates/dbos-db-starter/migrations/env.py.dbos +0 -0
  61. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_templates/dbos-db-starter/migrations/script.py.mako +0 -0
  62. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_templates/dbos-db-starter/migrations/versions/2024_07_31_180642_init.py +0 -0
  63. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_templates/dbos-db-starter/start_postgres_docker.py +0 -0
  64. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_tracer.py +0 -0
  65. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_utils.py +0 -0
  66. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/_workflow_commands.py +0 -0
  67. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/cli/_github_init.py +0 -0
  68. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/cli/_template_init.py +0 -0
  69. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/cli/cli.py +0 -0
  70. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/dbos-config.schema.json +0 -0
  71. {dbos-0.25.0a8 → dbos-0.25.0a9}/dbos/py.typed +0 -0
  72. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/__init__.py +0 -0
  73. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/atexit_no_ctor.py +0 -0
  74. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/atexit_no_launch.py +0 -0
  75. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/classdefs.py +0 -0
  76. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/conftest.py +0 -0
  77. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/more_classdefs.py +0 -0
  78. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/queuedworkflow.py +0 -0
  79. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_admin_server.py +0 -0
  80. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_async.py +0 -0
  81. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_concurrency.py +0 -0
  82. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_config.py +0 -0
  83. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_croniter.py +0 -0
  84. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_dbos.py +0 -0
  85. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_dbwizard.py +0 -0
  86. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_debug.py +0 -0
  87. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_failures.py +0 -0
  88. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_flask.py +0 -0
  89. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_kafka.py +0 -0
  90. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_outcome.py +0 -0
  91. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_package.py +0 -0
  92. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_queue.py +0 -0
  93. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_scheduler.py +0 -0
  94. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_schema_migration.py +0 -0
  95. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_singleton.py +0 -0
  96. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_spans.py +0 -0
  97. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_sqlalchemy.py +0 -0
  98. {dbos-0.25.0a8 → dbos-0.25.0a9}/tests/test_workflow_cmds.py +0 -0
  99. {dbos-0.25.0a8 → dbos-0.25.0a9}/version/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbos
3
- Version: 0.25.0a8
3
+ Version: 0.25.0a9
4
4
  Summary: Ultra-lightweight durable execution in Python
5
5
  Author-Email: "DBOS, Inc." <contact@dbos.dev>
6
6
  License: MIT
@@ -23,6 +23,7 @@ Requires-Dist: cryptography>=43.0.3
23
23
  Requires-Dist: rich>=13.9.4
24
24
  Requires-Dist: pyjwt>=2.10.1
25
25
  Requires-Dist: websockets>=15.0
26
+ Requires-Dist: pyright>=1.1.398
26
27
  Description-Content-Type: text/markdown
27
28
 
28
29
 
@@ -81,7 +81,6 @@ from ._sys_db import (
81
81
  if TYPE_CHECKING:
82
82
  from ._dbos import (
83
83
  DBOS,
84
- Workflow,
85
84
  WorkflowHandle,
86
85
  WorkflowHandleAsync,
87
86
  DBOSRegistry,
@@ -304,7 +303,7 @@ def _get_wf_invoke_func(
304
303
  def _execute_workflow_wthread(
305
304
  dbos: "DBOS",
306
305
  status: WorkflowStatusInternal,
307
- func: "Workflow[P, R]",
306
+ func: "Callable[P, R]",
308
307
  ctx: DBOSContext,
309
308
  *args: Any,
310
309
  **kwargs: Any,
@@ -335,7 +334,7 @@ def _execute_workflow_wthread(
335
334
  async def _execute_workflow_async(
336
335
  dbos: "DBOS",
337
336
  status: WorkflowStatusInternal,
338
- func: "Workflow[P, Coroutine[Any, Any, R]]",
337
+ func: "Callable[P, Coroutine[Any, Any, R]]",
339
338
  ctx: DBOSContext,
340
339
  *args: Any,
341
340
  **kwargs: Any,
@@ -449,7 +448,7 @@ def _get_new_wf() -> tuple[str, DBOSContext]:
449
448
 
450
449
  def start_workflow(
451
450
  dbos: "DBOS",
452
- func: "Workflow[P, Union[R, Coroutine[Any, Any, R]]]",
451
+ func: "Callable[P, Union[R, Coroutine[Any, Any, R]]]",
453
452
  queue_name: Optional[str],
454
453
  execute_workflow: bool,
455
454
  *args: P.args,
@@ -531,7 +530,7 @@ def start_workflow(
531
530
 
532
531
  async def start_workflow_async(
533
532
  dbos: "DBOS",
534
- func: "Workflow[P, Coroutine[Any, Any, R]]",
533
+ func: "Callable[P, Coroutine[Any, Any, R]]",
535
534
  queue_name: Optional[str],
536
535
  execute_workflow: bool,
537
536
  *args: P.args,
@@ -126,17 +126,6 @@ R = TypeVar("R", covariant=True) # A generic type for workflow return values
126
126
 
127
127
  T = TypeVar("T")
128
128
 
129
-
130
- class DBOSCallProtocol(Protocol[P, R]):
131
- __name__: str
132
- __qualname__: str
133
-
134
- def __call__(*args: P.args, **kwargs: P.kwargs) -> R: ...
135
-
136
-
137
- Workflow: TypeAlias = DBOSCallProtocol[P, R]
138
-
139
-
140
129
  IsolationLevel = Literal[
141
130
  "SERIALIZABLE",
142
131
  "REPEATABLE READ",
@@ -169,7 +158,7 @@ RegisteredJob = Tuple[
169
158
 
170
159
  class DBOSRegistry:
171
160
  def __init__(self) -> None:
172
- self.workflow_info_map: dict[str, Workflow[..., Any]] = {}
161
+ self.workflow_info_map: dict[str, Callable[..., Any]] = {}
173
162
  self.function_type_map: dict[str, str] = {}
174
163
  self.class_info_map: dict[str, type] = {}
175
164
  self.instance_info_map: dict[str, object] = {}
@@ -713,7 +702,7 @@ class DBOS:
713
702
  @classmethod
714
703
  def start_workflow(
715
704
  cls,
716
- func: Workflow[P, R],
705
+ func: Callable[P, R],
717
706
  *args: P.args,
718
707
  **kwargs: P.kwargs,
719
708
  ) -> WorkflowHandle[R]:
@@ -723,7 +712,7 @@ class DBOS:
723
712
  @classmethod
724
713
  async def start_workflow_async(
725
714
  cls,
726
- func: Workflow[P, Coroutine[Any, Any, R]],
715
+ func: Callable[P, Coroutine[Any, Any, R]],
727
716
  *args: P.args,
728
717
  **kwargs: P.kwargs,
729
718
  ) -> WorkflowHandleAsync[R]:
@@ -1,6 +1,6 @@
1
1
  import threading
2
2
  import traceback
3
- from typing import TYPE_CHECKING, Any, Coroutine, Optional, TypedDict
3
+ from typing import TYPE_CHECKING, Any, Callable, Coroutine, Optional, TypedDict
4
4
 
5
5
  from psycopg import errors
6
6
  from sqlalchemy.exc import OperationalError
@@ -10,7 +10,7 @@ from dbos._utils import GlobalParams
10
10
  from ._core import P, R, execute_workflow_by_id, start_workflow, start_workflow_async
11
11
 
12
12
  if TYPE_CHECKING:
13
- from ._dbos import DBOS, Workflow, WorkflowHandle, WorkflowHandleAsync
13
+ from ._dbos import DBOS, WorkflowHandle, WorkflowHandleAsync
14
14
 
15
15
 
16
16
  class QueueRateLimit(TypedDict):
@@ -59,7 +59,7 @@ class Queue:
59
59
  registry.queue_info_map[self.name] = self
60
60
 
61
61
  def enqueue(
62
- self, func: "Workflow[P, R]", *args: P.args, **kwargs: P.kwargs
62
+ self, func: "Callable[P, R]", *args: P.args, **kwargs: P.kwargs
63
63
  ) -> "WorkflowHandle[R]":
64
64
  from ._dbos import _get_dbos_instance
65
65
 
@@ -68,7 +68,7 @@ class Queue:
68
68
 
69
69
  async def enqueue_async(
70
70
  self,
71
- func: "Workflow[P, Coroutine[Any, Any, R]]",
71
+ func: "Callable[P, Coroutine[Any, Any, R]]",
72
72
  *args: P.args,
73
73
  **kwargs: P.kwargs,
74
74
  ) -> "WorkflowHandleAsync[R]":
@@ -24,10 +24,11 @@ dependencies = [
24
24
  "rich>=13.9.4",
25
25
  "pyjwt>=2.10.1",
26
26
  "websockets>=15.0",
27
+ "pyright>=1.1.398",
27
28
  ]
28
29
  requires-python = ">=3.9"
29
30
  readme = "README.md"
30
- version = "0.25.0a8"
31
+ version = "0.25.0a9"
31
32
 
32
33
  [project.license]
33
34
  text = "MIT"
@@ -86,4 +87,5 @@ dev = [
86
87
  "pytest-order>=1.3.0",
87
88
  "pdm-backend>=2.4.2",
88
89
  "pytest-asyncio>=0.25.0",
90
+ "pyright>=1.1.398",
89
91
  ]
@@ -419,7 +419,7 @@ def test_class_recovery(dbos: DBOS) -> None:
419
419
  def test_inst_recovery(dbos: DBOS) -> None:
420
420
  wfid = str(uuid.uuid4())
421
421
  exc_cnt: int = 0
422
- last_inst: Optional[TestClass] = None
422
+ last_inst: Optional["TestClass"] = None
423
423
 
424
424
  @DBOS.dbos_class()
425
425
  class TestClass(DBOSConfiguredInstance):
@@ -172,7 +172,7 @@ async def test_custom_lifespan(
172
172
  resource = None
173
173
  port = 8000
174
174
 
175
- @asynccontextmanager
175
+ @asynccontextmanager # pyright: ignore
176
176
  async def lifespan(app: FastAPI) -> Any:
177
177
  nonlocal resource
178
178
  resource = 1
@@ -308,7 +308,9 @@ def test_role_tracing() -> None:
308
308
  provider.add_span_processor(span_processor)
309
309
 
310
310
  def function_to_trace() -> None:
311
- with provider.get_tracer(__name__).start_as_current_span("test-span") as span:
311
+ with provider.get_tracer(__name__).start_as_current_span( # pyright: ignore
312
+ "test-span"
313
+ ) as span:
312
314
  span.set_attribute("testattribute", "value")
313
315
 
314
316
  # Clear any existing spans
@@ -71,8 +71,8 @@ def test_two_steps_cancel(dbos: DBOS, config: ConfigFile) -> None:
71
71
  return
72
72
 
73
73
  # run the workflow
74
+ wfuuid = str(uuid.uuid4())
74
75
  try:
75
- wfuuid = str(uuid.uuid4())
76
76
  with SetWorkflowID(wfuuid):
77
77
  simple_workflow()
78
78
 
@@ -116,8 +116,8 @@ def test_two_transactions_cancel(dbos: DBOS, config: ConfigFile) -> None:
116
116
  return
117
117
 
118
118
  # run the workflow
119
+ wfuuid = str(uuid.uuid4())
119
120
  try:
120
- wfuuid = str(uuid.uuid4())
121
121
  with SetWorkflowID(wfuuid):
122
122
  simple_workflow()
123
123
 
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
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
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
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
File without changes
File without changes
File without changes
File without changes
File without changes