dbos 0.20.0a5__tar.gz → 0.20.0a6__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.
- {dbos-0.20.0a5 → dbos-0.20.0a6}/PKG-INFO +1 -1
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_dbos.py +1 -1
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_sys_db.py +1 -1
- {dbos-0.20.0a5 → dbos-0.20.0a6}/pyproject.toml +1 -1
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/conftest.py +6 -6
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_async.py +1 -1
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_dbos.py +16 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/LICENSE +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/README.md +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/__init__.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_admin_server.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_app_db.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_classproperty.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_cloudutils/authentication.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_cloudutils/cloudutils.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_cloudutils/databases.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_context.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_core.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_croniter.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_db_wizard.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_dbos_config.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_error.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_fastapi.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_flask.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_kafka.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_kafka_message.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_logger.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_migrations/env.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_migrations/script.py.mako +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_migrations/versions/04ca4f231047_workflow_queues_executor_id.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_migrations/versions/50f3227f0b4b_fix_job_queue.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_migrations/versions/5c361fc04708_added_system_tables.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_migrations/versions/a3b18ad34abe_added_triggers.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_migrations/versions/d76646551a6b_job_queue_limiter.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_migrations/versions/d76646551a6c_workflow_queue.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_migrations/versions/eab0cc1d9a14_job_queue.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_outcome.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_queue.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_recovery.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_registrations.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_request.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_roles.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_scheduler.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_schemas/__init__.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_schemas/application_database.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_schemas/system_database.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_serialization.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_templates/dbos-db-starter/README.md +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_templates/dbos-db-starter/__package/__init__.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_templates/dbos-db-starter/__package/main.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_templates/dbos-db-starter/__package/schema.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_templates/dbos-db-starter/alembic.ini +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_templates/dbos-db-starter/dbos-config.yaml.dbos +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_templates/dbos-db-starter/migrations/env.py.dbos +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_templates/dbos-db-starter/migrations/script.py.mako +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_templates/dbos-db-starter/migrations/versions/2024_07_31_180642_init.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_templates/dbos-db-starter/start_postgres_docker.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_tracer.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_workflow_commands.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/cli/_github_init.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/cli/_template_init.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/cli/cli.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/dbos-config.schema.json +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/py.typed +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/__init__.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/atexit_no_ctor.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/atexit_no_launch.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/classdefs.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/more_classdefs.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/queuedworkflow.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_admin_server.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_classdecorators.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_concurrency.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_config.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_croniter.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_failures.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_fastapi.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_fastapi_roles.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_flask.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_kafka.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_outcome.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_package.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_queue.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_scheduler.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_schema_migration.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_singleton.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_spans.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/tests/test_workflow_cmds.py +0 -0
- {dbos-0.20.0a5 → dbos-0.20.0a6}/version/__init__.py +0 -0
|
@@ -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()
|
|
@@ -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
|
)
|
|
@@ -98,7 +98,7 @@ def cleanup_test_databases(config: ConfigFile, postgres_db_engine: sa.Engine) ->
|
|
|
98
98
|
def dbos(
|
|
99
99
|
config: ConfigFile, cleanup_test_databases: None
|
|
100
100
|
) -> Generator[DBOS, Any, None]:
|
|
101
|
-
DBOS.destroy()
|
|
101
|
+
DBOS.destroy(destroy_registry=True)
|
|
102
102
|
|
|
103
103
|
# This launches for test convenience.
|
|
104
104
|
# Tests add to running DBOS and then call stuff without adding
|
|
@@ -109,14 +109,14 @@ def dbos(
|
|
|
109
109
|
DBOS.launch()
|
|
110
110
|
|
|
111
111
|
yield dbos
|
|
112
|
-
DBOS.destroy()
|
|
112
|
+
DBOS.destroy(destroy_registry=True)
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
@pytest.fixture()
|
|
116
116
|
def dbos_fastapi(
|
|
117
117
|
config: ConfigFile, cleanup_test_databases: None
|
|
118
118
|
) -> Generator[Tuple[DBOS, FastAPI], Any, None]:
|
|
119
|
-
DBOS.destroy()
|
|
119
|
+
DBOS.destroy(destroy_registry=True)
|
|
120
120
|
app = FastAPI()
|
|
121
121
|
dbos = DBOS(fastapi=app, config=config)
|
|
122
122
|
|
|
@@ -125,14 +125,14 @@ def dbos_fastapi(
|
|
|
125
125
|
DBOS.launch()
|
|
126
126
|
|
|
127
127
|
yield dbos, app
|
|
128
|
-
DBOS.destroy()
|
|
128
|
+
DBOS.destroy(destroy_registry=True)
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
@pytest.fixture()
|
|
132
132
|
def dbos_flask(
|
|
133
133
|
config: ConfigFile, cleanup_test_databases: None
|
|
134
134
|
) -> Generator[Tuple[DBOS, Flask], Any, None]:
|
|
135
|
-
DBOS.destroy()
|
|
135
|
+
DBOS.destroy(destroy_registry=True)
|
|
136
136
|
app = Flask(__name__)
|
|
137
137
|
|
|
138
138
|
dbos = DBOS(flask=app, config=config)
|
|
@@ -142,7 +142,7 @@ def dbos_flask(
|
|
|
142
142
|
DBOS.launch()
|
|
143
143
|
|
|
144
144
|
yield dbos, app
|
|
145
|
-
DBOS.destroy()
|
|
145
|
+
DBOS.destroy(destroy_registry=True)
|
|
146
146
|
|
|
147
147
|
|
|
148
148
|
# Pretty-print test names
|
|
@@ -303,7 +303,7 @@ def test_async_tx_raises(config: ConfigFile) -> None:
|
|
|
303
303
|
pass
|
|
304
304
|
|
|
305
305
|
# destroy call needed to avoid "functions were registered but DBOS() was not called" warning
|
|
306
|
-
DBOS.destroy()
|
|
306
|
+
DBOS.destroy(destroy_registry=True)
|
|
307
307
|
|
|
308
308
|
|
|
309
309
|
@pytest.mark.asyncio
|
|
@@ -1212,3 +1212,19 @@ def test_debug_logging(dbos: DBOS, caplog: pytest.LogCaptureFixture) -> None:
|
|
|
1212
1212
|
|
|
1213
1213
|
# Reset logging
|
|
1214
1214
|
logging.getLogger("dbos").propagate = original_propagate
|
|
1215
|
+
|
|
1216
|
+
|
|
1217
|
+
def test_destroy_semantics(dbos: DBOS, config: ConfigFile) -> None:
|
|
1218
|
+
|
|
1219
|
+
@DBOS.workflow()
|
|
1220
|
+
def test_workflow(var: str) -> str:
|
|
1221
|
+
return var
|
|
1222
|
+
|
|
1223
|
+
var = "test"
|
|
1224
|
+
assert test_workflow(var) == var
|
|
1225
|
+
|
|
1226
|
+
DBOS.destroy()
|
|
1227
|
+
DBOS(config=config)
|
|
1228
|
+
DBOS.launch()
|
|
1229
|
+
|
|
1230
|
+
assert test_workflow(var) == var
|
|
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
|
{dbos-0.20.0a5 → dbos-0.20.0a6}/dbos/_migrations/versions/5c361fc04708_added_system_tables.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|