dbos 0.10.0a1__tar.gz → 0.10.0a3__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 (75) hide show
  1. {dbos-0.10.0a1 → dbos-0.10.0a3}/PKG-INFO +9 -9
  2. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/dbos.py +29 -6
  3. {dbos-0.10.0a1 → dbos-0.10.0a3}/pyproject.toml +18 -18
  4. {dbos-0.10.0a1 → dbos-0.10.0a3}/LICENSE +0 -0
  5. {dbos-0.10.0a1 → dbos-0.10.0a3}/README.md +0 -0
  6. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/__init__.py +0 -0
  7. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/admin_sever.py +0 -0
  8. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/application_database.py +0 -0
  9. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/cli.py +0 -0
  10. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/context.py +0 -0
  11. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/core.py +0 -0
  12. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/dbos-config.schema.json +0 -0
  13. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/dbos_config.py +0 -0
  14. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/decorators.py +0 -0
  15. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/error.py +0 -0
  16. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/fastapi.py +0 -0
  17. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/flask.py +0 -0
  18. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/kafka.py +0 -0
  19. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/kafka_message.py +0 -0
  20. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/logger.py +0 -0
  21. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/migrations/env.py +0 -0
  22. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/migrations/script.py.mako +0 -0
  23. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/migrations/versions/50f3227f0b4b_fix_job_queue.py +0 -0
  24. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/migrations/versions/5c361fc04708_added_system_tables.py +0 -0
  25. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/migrations/versions/a3b18ad34abe_added_triggers.py +0 -0
  26. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/migrations/versions/d76646551a6b_job_queue_limiter.py +0 -0
  27. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/migrations/versions/d76646551a6c_workflow_queue.py +0 -0
  28. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/migrations/versions/eab0cc1d9a14_job_queue.py +0 -0
  29. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/py.typed +0 -0
  30. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/queue.py +0 -0
  31. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/recovery.py +0 -0
  32. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/registrations.py +0 -0
  33. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/request.py +0 -0
  34. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/roles.py +0 -0
  35. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/scheduler/croniter.py +0 -0
  36. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/scheduler/scheduler.py +0 -0
  37. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/schemas/__init__.py +0 -0
  38. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/schemas/application_database.py +0 -0
  39. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/schemas/system_database.py +0 -0
  40. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/system_database.py +0 -0
  41. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/templates/hello/README.md +0 -0
  42. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/templates/hello/__package/__init__.py +0 -0
  43. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/templates/hello/__package/main.py +0 -0
  44. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/templates/hello/__package/schema.py +0 -0
  45. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/templates/hello/alembic.ini +0 -0
  46. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/templates/hello/dbos-config.yaml.dbos +0 -0
  47. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/templates/hello/migrations/env.py.dbos +0 -0
  48. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/templates/hello/migrations/script.py.mako +0 -0
  49. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/templates/hello/migrations/versions/2024_07_31_180642_init.py +0 -0
  50. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/templates/hello/start_postgres_docker.py +0 -0
  51. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/tracer.py +0 -0
  52. {dbos-0.10.0a1 → dbos-0.10.0a3}/dbos/utils.py +0 -0
  53. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/__init__.py +0 -0
  54. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/atexit_no_ctor.py +0 -0
  55. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/atexit_no_launch.py +0 -0
  56. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/classdefs.py +0 -0
  57. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/conftest.py +0 -0
  58. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/more_classdefs.py +0 -0
  59. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/scheduler/test_croniter.py +0 -0
  60. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/scheduler/test_scheduler.py +0 -0
  61. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_admin_server.py +0 -0
  62. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_classdecorators.py +0 -0
  63. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_concurrency.py +0 -0
  64. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_config.py +0 -0
  65. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_dbos.py +0 -0
  66. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_failures.py +0 -0
  67. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_fastapi.py +0 -0
  68. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_fastapi_roles.py +0 -0
  69. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_flask.py +0 -0
  70. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_kafka.py +0 -0
  71. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_package.py +0 -0
  72. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_queue.py +0 -0
  73. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_schema_migration.py +0 -0
  74. {dbos-0.10.0a1 → dbos-0.10.0a3}/tests/test_singleton.py +0 -0
  75. {dbos-0.10.0a1 → dbos-0.10.0a3}/version/__init__.py +0 -0
@@ -1,24 +1,24 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbos
3
- Version: 0.10.0a1
3
+ Version: 0.10.0a3
4
4
  Summary: Ultra-lightweight durable execution in Python
5
5
  Author-Email: "DBOS, Inc." <contact@dbos.dev>
6
6
  License: MIT
7
7
  Requires-Python: >=3.9
8
8
  Requires-Dist: pyyaml>=6.0.2
9
9
  Requires-Dist: jsonschema>=4.23.0
10
- Requires-Dist: alembic>=1.13.2
10
+ Requires-Dist: alembic>=1.13.3
11
11
  Requires-Dist: typing-extensions>=4.12.2; python_version < "3.10"
12
- Requires-Dist: typer>=0.12.3
13
- Requires-Dist: jsonpickle>=3.2.2
14
- Requires-Dist: opentelemetry-api>=1.26.0
15
- Requires-Dist: opentelemetry-sdk>=1.26.0
16
- Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.26.0
12
+ Requires-Dist: typer>=0.12.5
13
+ Requires-Dist: jsonpickle>=3.3.0
14
+ Requires-Dist: opentelemetry-api>=1.27.0
15
+ Requires-Dist: opentelemetry-sdk>=1.27.0
16
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.27.0
17
17
  Requires-Dist: python-dateutil>=2.9.0.post0
18
- Requires-Dist: fastapi[standard]>=0.112.1
18
+ Requires-Dist: fastapi[standard]>=0.115.2
19
19
  Requires-Dist: psutil>=6.0.0
20
20
  Requires-Dist: tomlkit>=0.13.2
21
- Requires-Dist: psycopg>=3.2.1
21
+ Requires-Dist: psycopg>=3.2.3
22
22
  Description-Content-Type: text/markdown
23
23
 
24
24
 
@@ -277,6 +277,7 @@ class DBOS:
277
277
  self.fastapi: Optional["FastAPI"] = fastapi
278
278
  self.flask: Optional["Flask"] = flask
279
279
  self._executor_field: Optional[ThreadPoolExecutor] = None
280
+ self._background_threads: List[threading.Thread] = []
280
281
 
281
282
  # If using FastAPI, set up middleware and lifecycle events
282
283
  if self.fastapi is not None:
@@ -358,20 +359,38 @@ class DBOS:
358
359
  self._executor.submit(_startup_recovery_thread, self, workflow_ids)
359
360
 
360
361
  # Listen to notifications
361
- self._executor.submit(self._sys_db._notification_listener)
362
+ notification_listener_thread = threading.Thread(
363
+ target=self._sys_db._notification_listener,
364
+ daemon=True,
365
+ )
366
+ notification_listener_thread.start()
367
+ self._background_threads.append(notification_listener_thread)
362
368
 
363
369
  # Start flush workflow buffers thread
364
- self._executor.submit(self._sys_db.flush_workflow_buffers)
370
+ flush_workflow_buffers_thread = threading.Thread(
371
+ target=self._sys_db.flush_workflow_buffers,
372
+ daemon=True,
373
+ )
374
+ flush_workflow_buffers_thread.start()
375
+ self._background_threads.append(flush_workflow_buffers_thread)
365
376
 
366
377
  # Start the queue thread
367
378
  evt = threading.Event()
368
379
  self.stop_events.append(evt)
369
- self._executor.submit(queue_thread, evt, self)
380
+ bg_queue_thread = threading.Thread(
381
+ target=queue_thread, args=(evt, self), daemon=True
382
+ )
383
+ bg_queue_thread.start()
384
+ self._background_threads.append(bg_queue_thread)
370
385
 
371
386
  # Grab any pollers that were deferred and start them
372
387
  for evt, func, args, kwargs in self._registry.pollers:
373
388
  self.stop_events.append(evt)
374
- self._executor.submit(func, *args, **kwargs)
389
+ poller_thread = threading.Thread(
390
+ target=func, args=args, kwargs=kwargs, daemon=True
391
+ )
392
+ poller_thread.start()
393
+ self._background_threads.append(poller_thread)
375
394
  self._registry.pollers = []
376
395
 
377
396
  dbos_logger.info("DBOS launched")
@@ -403,6 +422,8 @@ class DBOS:
403
422
  if self._executor_field is not None:
404
423
  self._executor_field.shutdown(cancel_futures=True)
405
424
  self._executor_field = None
425
+ for bg_thread in self._background_threads:
426
+ bg_thread.join()
406
427
 
407
428
  @classmethod
408
429
  def register_instance(cls, inst: object) -> None:
@@ -832,7 +853,7 @@ class DBOSConfiguredInstance:
832
853
 
833
854
  # Apps that import DBOS probably don't exit. If they do, let's see if
834
855
  # it looks like startup was abandoned or a call was forgotten...
835
- def log_exit_info() -> None:
856
+ def dbos_exit_hook() -> None:
836
857
  if _dbos_global_registry is None:
837
858
  # Probably used as or for a support module
838
859
  return
@@ -846,7 +867,9 @@ def log_exit_info() -> None:
846
867
  print("DBOS exiting; DBOS exists but launch() was not called")
847
868
  dbos_logger.warning("DBOS exiting; DBOS exists but launch() was not called")
848
869
  return
870
+ # If we get here, we're exiting normally
871
+ _dbos_global_instance.destroy()
849
872
 
850
873
 
851
874
  # Register the exit hook
852
- atexit.register(log_exit_info)
875
+ atexit.register(dbos_exit_hook)
@@ -8,22 +8,22 @@ authors = [
8
8
  dependencies = [
9
9
  "pyyaml>=6.0.2",
10
10
  "jsonschema>=4.23.0",
11
- "alembic>=1.13.2",
11
+ "alembic>=1.13.3",
12
12
  "typing-extensions>=4.12.2; python_version < \"3.10\"",
13
- "typer>=0.12.3",
14
- "jsonpickle>=3.2.2",
15
- "opentelemetry-api>=1.26.0",
16
- "opentelemetry-sdk>=1.26.0",
17
- "opentelemetry-exporter-otlp-proto-http>=1.26.0",
13
+ "typer>=0.12.5",
14
+ "jsonpickle>=3.3.0",
15
+ "opentelemetry-api>=1.27.0",
16
+ "opentelemetry-sdk>=1.27.0",
17
+ "opentelemetry-exporter-otlp-proto-http>=1.27.0",
18
18
  "python-dateutil>=2.9.0.post0",
19
- "fastapi[standard]>=0.112.1",
19
+ "fastapi[standard]>=0.115.2",
20
20
  "psutil>=6.0.0",
21
21
  "tomlkit>=0.13.2",
22
- "psycopg>=3.2.1",
22
+ "psycopg>=3.2.3",
23
23
  ]
24
24
  requires-python = ">=3.9"
25
25
  readme = "README.md"
26
- version = "0.10.0a1"
26
+ version = "0.10.0a3"
27
27
 
28
28
  [project.license]
29
29
  text = "MIT"
@@ -46,26 +46,26 @@ version_format = "version:format_version"
46
46
 
47
47
  [tool.pdm.dev-dependencies]
48
48
  dev = [
49
- "pytest>=8.3.2",
50
- "mypy>=1.11.1",
49
+ "pytest>=8.3.3",
50
+ "mypy>=1.12.0",
51
51
  "pytest-mock>=3.14.0",
52
52
  "types-PyYAML>=6.0.12.20240808",
53
53
  "types-jsonschema>=4.23.0.20240813",
54
- "black>=24.8.0",
55
- "pre-commit>=3.8.0",
54
+ "black>=24.10.0",
55
+ "pre-commit>=4.0.1",
56
56
  "isort>=5.13.2",
57
57
  "types-psutil>=6.0.0.20240621",
58
58
  "requests>=2.32.3",
59
- "types-requests>=2.32.0.20240712",
60
- "httpx>=0.27.0",
61
- "pytz>=2024.1",
59
+ "types-requests>=2.32.0.20240914",
60
+ "httpx>=0.27.2",
61
+ "pytz>=2024.2",
62
62
  "GitPython>=3.1.43",
63
- "confluent-kafka>=2.5.3",
63
+ "confluent-kafka>=2.6.0",
64
64
  "types-confluent-kafka>=1.2.2",
65
65
  "flask>=3.0.3",
66
66
  "pytest-order>=1.3.0",
67
67
  "pyjwt>=2.9.0",
68
- "pdm-backend>=2.3.3",
68
+ "pdm-backend>=2.4.2",
69
69
  ]
70
70
 
71
71
  [tool.black]
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