dbos 0.20.0a3__py3-none-any.whl → 0.20.0a6__py3-none-any.whl
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.
- dbos/_core.py +21 -1
- dbos/_dbos.py +1 -1
- dbos/_fastapi.py +10 -9
- dbos/_sys_db.py +1 -1
- {dbos-0.20.0a3.dist-info → dbos-0.20.0a6.dist-info}/METADATA +1 -1
- {dbos-0.20.0a3.dist-info → dbos-0.20.0a6.dist-info}/RECORD +9 -9
- {dbos-0.20.0a3.dist-info → dbos-0.20.0a6.dist-info}/WHEEL +0 -0
- {dbos-0.20.0a3.dist-info → dbos-0.20.0a6.dist-info}/entry_points.txt +0 -0
- {dbos-0.20.0a3.dist-info → dbos-0.20.0a6.dist-info}/licenses/LICENSE +0 -0
dbos/_core.py
CHANGED
|
@@ -488,6 +488,22 @@ def start_workflow(
|
|
|
488
488
|
return WorkflowHandleFuture(new_wf_id, future, dbos)
|
|
489
489
|
|
|
490
490
|
|
|
491
|
+
if sys.version_info < (3, 12):
|
|
492
|
+
|
|
493
|
+
def _mark_coroutine(func: Callable[P, R]) -> Callable[P, R]:
|
|
494
|
+
@wraps(func)
|
|
495
|
+
async def async_wrapper(*args: Any, **kwargs: Any) -> R:
|
|
496
|
+
return await func(*args, **kwargs) # type: ignore
|
|
497
|
+
|
|
498
|
+
return async_wrapper # type: ignore
|
|
499
|
+
|
|
500
|
+
else:
|
|
501
|
+
|
|
502
|
+
def _mark_coroutine(func: Callable[P, R]) -> Callable[P, R]:
|
|
503
|
+
inspect.markcoroutinefunction(func)
|
|
504
|
+
return func
|
|
505
|
+
|
|
506
|
+
|
|
491
507
|
def workflow_wrapper(
|
|
492
508
|
dbosreg: "DBOSRegistry",
|
|
493
509
|
func: Callable[P, R],
|
|
@@ -548,7 +564,7 @@ def workflow_wrapper(
|
|
|
548
564
|
)
|
|
549
565
|
return outcome() # type: ignore
|
|
550
566
|
|
|
551
|
-
return wrapper
|
|
567
|
+
return _mark_coroutine(wrapper) if inspect.iscoroutinefunction(func) else wrapper
|
|
552
568
|
|
|
553
569
|
|
|
554
570
|
def decorate_workflow(
|
|
@@ -838,6 +854,10 @@ def decorate_step(
|
|
|
838
854
|
assert tempwf
|
|
839
855
|
return tempwf(*args, **kwargs)
|
|
840
856
|
|
|
857
|
+
wrapper = (
|
|
858
|
+
_mark_coroutine(wrapper) if inspect.iscoroutinefunction(func) else wrapper # type: ignore
|
|
859
|
+
)
|
|
860
|
+
|
|
841
861
|
def temp_wf_sync(*args: Any, **kwargs: Any) -> Any:
|
|
842
862
|
return wrapper(*args, **kwargs)
|
|
843
863
|
|
dbos/_dbos.py
CHANGED
|
@@ -245,7 +245,7 @@ class DBOS:
|
|
|
245
245
|
return _dbos_global_instance
|
|
246
246
|
|
|
247
247
|
@classmethod
|
|
248
|
-
def destroy(cls, *, destroy_registry: bool =
|
|
248
|
+
def destroy(cls, *, destroy_registry: bool = False) -> None:
|
|
249
249
|
global _dbos_global_instance
|
|
250
250
|
if _dbos_global_instance is not None:
|
|
251
251
|
_dbos_global_instance._destroy()
|
dbos/_fastapi.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import uuid
|
|
2
|
-
from typing import Any, Callable, cast
|
|
2
|
+
from typing import Any, Callable, MutableMapping, cast
|
|
3
3
|
|
|
4
4
|
from fastapi import FastAPI
|
|
5
5
|
from fastapi import Request as FastAPIRequest
|
|
6
6
|
from fastapi.responses import JSONResponse
|
|
7
|
-
from starlette.types import ASGIApp,
|
|
7
|
+
from starlette.types import ASGIApp, Receive, Scope, Send
|
|
8
8
|
|
|
9
9
|
from . import DBOS
|
|
10
10
|
from ._context import (
|
|
@@ -61,15 +61,16 @@ class LifespanMiddleware:
|
|
|
61
61
|
|
|
62
62
|
async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
|
|
63
63
|
if scope["type"] == "lifespan":
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if message["type"] == "lifespan.startup":
|
|
64
|
+
|
|
65
|
+
async def wrapped_send(message: MutableMapping[str, Any]) -> None:
|
|
66
|
+
if message["type"] == "lifespan.startup.complete":
|
|
67
67
|
self.dbos._launch()
|
|
68
|
-
|
|
69
|
-
elif message["type"] == "lifespan.shutdown":
|
|
68
|
+
elif message["type"] == "lifespan.shutdown.complete":
|
|
70
69
|
self.dbos._destroy()
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
await send(message)
|
|
71
|
+
|
|
72
|
+
# Call the original app with our wrapped functions
|
|
73
|
+
await self.app(scope, receive, wrapped_send)
|
|
73
74
|
else:
|
|
74
75
|
await self.app(scope, receive, send)
|
|
75
76
|
|
dbos/_sys_db.py
CHANGED
|
@@ -367,7 +367,7 @@ class SystemDatabase:
|
|
|
367
367
|
with self.engine.begin() as c:
|
|
368
368
|
stmt = (
|
|
369
369
|
sa.update(SystemSchema.workflow_status)
|
|
370
|
-
.where(SystemSchema.
|
|
370
|
+
.where(SystemSchema.workflow_status.c.workflow_uuid == workflow_uuid)
|
|
371
371
|
.values(
|
|
372
372
|
status=status,
|
|
373
373
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
dbos-0.20.
|
|
2
|
-
dbos-0.20.
|
|
3
|
-
dbos-0.20.
|
|
4
|
-
dbos-0.20.
|
|
1
|
+
dbos-0.20.0a6.dist-info/METADATA,sha256=L5l0UVUGSiuvP67hiPb_0wGijMUjGtLscQkdpc62vEE,5309
|
|
2
|
+
dbos-0.20.0a6.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
|
3
|
+
dbos-0.20.0a6.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
|
|
4
|
+
dbos-0.20.0a6.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
|
|
5
5
|
dbos/__init__.py,sha256=CxRHBHEthPL4PZoLbZhp3rdm44-KkRTT2-7DkK9d4QQ,724
|
|
6
6
|
dbos/_admin_server.py,sha256=PJgneZG9-64TapZrPeJtt73puAswRImCE5uce2k2PKU,4750
|
|
7
7
|
dbos/_app_db.py,sha256=_tv2vmPjjiaikwgxH3mqxgJ4nUUcG2-0uMXKWCqVu1c,5509
|
|
@@ -10,13 +10,13 @@ dbos/_cloudutils/authentication.py,sha256=V0fCWQN9stCkhbuuxgPTGpvuQcDqfU3KAxPAh0
|
|
|
10
10
|
dbos/_cloudutils/cloudutils.py,sha256=5e3CW1deSW-dI5G3QN0XbiVsBhyqT8wu7fuV2f8wtGU,7688
|
|
11
11
|
dbos/_cloudutils/databases.py,sha256=x4187Djsyoa-QaG3Kog8JT2_GERsnqa93LIVanmVUmg,8393
|
|
12
12
|
dbos/_context.py,sha256=RH08s_nee95vgxdz6AsYuVWF1LuJSVtOyIifblsa4pw,18760
|
|
13
|
-
dbos/_core.py,sha256
|
|
13
|
+
dbos/_core.py,sha256=-2oh2-NicMJBwTwrd2EQBQm4Vu0caozFeoS9Kj47DzM,36588
|
|
14
14
|
dbos/_croniter.py,sha256=hbhgfsHBqclUS8VeLnJ9PSE9Z54z6mi4nnrr1aUXn0k,47561
|
|
15
15
|
dbos/_db_wizard.py,sha256=xgKLna0_6Xi50F3o8msRosXba8NScHlpJR5ICVCkHDQ,7534
|
|
16
|
-
dbos/_dbos.py,sha256=
|
|
16
|
+
dbos/_dbos.py,sha256=VeSw9768_qa1kn4QRlmO1iymcHIhGXtcXsiwL9h8Zzc,35386
|
|
17
17
|
dbos/_dbos_config.py,sha256=h_q1gzudhsAMVkGMD0qQ6kLic6YhdJgzm50YFSIx9Bo,8196
|
|
18
18
|
dbos/_error.py,sha256=vtaSsG0QW6cRlwfZ4zzZWy_IHCZlomwSlrDyGWuyn8c,4337
|
|
19
|
-
dbos/_fastapi.py,sha256=
|
|
19
|
+
dbos/_fastapi.py,sha256=ke03vqsSYDnO6XeOtOVFXj0-f-v1MGsOxa9McaROvNc,3616
|
|
20
20
|
dbos/_flask.py,sha256=DZKUZR5-xOzPI7tYZ53r2PvvHVoAb8SYwLzMVFsVfjI,2608
|
|
21
21
|
dbos/_kafka.py,sha256=o6DbwnsYRDtvVTZVsN7BAK8cdP79AfoWX3Q7CGY2Yuo,4199
|
|
22
22
|
dbos/_kafka_message.py,sha256=NYvOXNG3Qn7bghn1pv3fg4Pbs86ILZGcK4IB-MLUNu0,409
|
|
@@ -41,7 +41,7 @@ dbos/_schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
41
41
|
dbos/_schemas/application_database.py,sha256=KeyoPrF7hy_ODXV7QNike_VFSD74QBRfQ76D7QyE9HI,966
|
|
42
42
|
dbos/_schemas/system_database.py,sha256=rwp4EvCSaXcUoMaRczZCvETCxGp72k3-hvLyGUDkih0,5163
|
|
43
43
|
dbos/_serialization.py,sha256=YCYv0qKAwAZ1djZisBC7khvKqG-5OcIv9t9EC5PFIog,1743
|
|
44
|
-
dbos/_sys_db.py,sha256=
|
|
44
|
+
dbos/_sys_db.py,sha256=wru-RJL2ANn05PzU3tclaoz5V1cpMGC9G54A87I9830,52290
|
|
45
45
|
dbos/_templates/dbos-db-starter/README.md,sha256=GhxhBj42wjTt1fWEtwNriHbJuKb66Vzu89G4pxNHw2g,930
|
|
46
46
|
dbos/_templates/dbos-db-starter/__package/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
47
|
dbos/_templates/dbos-db-starter/__package/main.py,sha256=eI0SS9Nwj-fldtiuSzIlIG6dC91GXXwdRsoHxv6S_WI,2719
|
|
@@ -60,4 +60,4 @@ dbos/cli/cli.py,sha256=4YRwY9fIOPAP7CS1OhTOZvLeyihK6ddn0KcYRDvX0E8,13928
|
|
|
60
60
|
dbos/dbos-config.schema.json,sha256=X5TpXNcARGceX0zQs0fVgtZW_Xj9uBbY5afPt9Rz9yk,5741
|
|
61
61
|
dbos/py.typed,sha256=QfzXT1Ktfk3Rj84akygc7_42z0lRpCq0Ilh8OXI6Zas,44
|
|
62
62
|
version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
|
|
63
|
-
dbos-0.20.
|
|
63
|
+
dbos-0.20.0a6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|