celestialflow 3.1.9__tar.gz → 3.2.0__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 (97) hide show
  1. {celestialflow-3.1.9 → celestialflow-3.2.0}/PKG-INFO +22 -20
  2. {celestialflow-3.1.9 → celestialflow-3.2.0}/README.md +21 -19
  3. {celestialflow-3.1.9 → celestialflow-3.2.0}/pyproject.toml +80 -81
  4. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/funnel/core_spout.py +3 -6
  5. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/graph/core_graph.py +147 -196
  6. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/graph/core_structure.py +62 -32
  7. celestialflow-3.2.0/src/celestialflow/graph/util_analysis.py +73 -0
  8. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/graph/util_serialize.py +23 -16
  9. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/observability/core_observer.py +4 -1
  10. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/observability/core_report.py +27 -24
  11. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/persistence/core_fail.py +7 -4
  12. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/persistence/core_log.py +11 -39
  13. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/persistence/util_jsonl.py +18 -15
  14. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/core_dispatch.py +27 -20
  15. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/core_envelope.py +6 -6
  16. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/core_metrics.py +10 -13
  17. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/core_queue.py +18 -23
  18. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/util_errors.py +5 -21
  19. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/util_estimators.py +12 -9
  20. celestialflow-3.2.0/src/celestialflow/runtime/util_factories.py +48 -0
  21. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/util_hash.py +9 -8
  22. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/util_types.py +19 -17
  23. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/stage/core_executor.py +64 -103
  24. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/stage/core_stage.py +79 -69
  25. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/stage/core_stages.py +37 -36
  26. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/utils/util_benchmark.py +45 -33
  27. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/utils/util_clone.py +30 -22
  28. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/utils/util_collections.py +1 -1
  29. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/utils/util_format.py +25 -18
  30. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/__init__.py +1 -1
  31. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/core_server.py +530 -522
  32. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/css/base.css +108 -1
  33. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/main.js +36 -6
  34. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_analysis.js +3 -2
  35. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_errors.js +9 -7
  36. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_history.js +8 -4
  37. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_injection.js +4 -3
  38. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_statuses.js +16 -7
  39. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_structure.js +7 -4
  40. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_summary.js +4 -2
  41. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/web_config.js +11 -1
  42. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/main.ts +40 -6
  43. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_analysis.ts +3 -2
  44. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_errors.ts +10 -8
  45. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_history.ts +6 -4
  46. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_injection.ts +4 -3
  47. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_statuses.ts +17 -11
  48. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_structure.ts +8 -4
  49. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/task_summary.ts +4 -2
  50. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/web_config.ts +13 -2
  51. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/templates/index.html +32 -9
  52. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/util_config.py +4 -3
  53. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow.egg-info/PKG-INFO +22 -20
  54. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow.egg-info/SOURCES.txt +2 -2
  55. celestialflow-3.2.0/tests/test_analysis.py +132 -0
  56. {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_envelope.py +22 -2
  57. {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_executor.py +2 -15
  58. {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_graph.py +674 -579
  59. {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_metrics.py +9 -9
  60. {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_stage.py +91 -120
  61. celestialflow-3.2.0/tests/test_structure.py +85 -0
  62. celestialflow-3.1.9/src/celestialflow/graph/util_analysis.py +0 -55
  63. celestialflow-3.1.9/src/celestialflow/runtime/util_factories.py +0 -95
  64. celestialflow-3.1.9/src/celestialflow/runtime/util_queue.py +0 -13
  65. celestialflow-3.1.9/src/celestialflow/utils/util_debug.py +0 -16
  66. {celestialflow-3.1.9 → celestialflow-3.2.0}/setup.cfg +0 -0
  67. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/__init__.py +0 -0
  68. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/funnel/__init__.py +0 -0
  69. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/funnel/core_inlet.py +0 -0
  70. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/graph/__init__.py +0 -0
  71. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/observability/__init__.py +0 -0
  72. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/observability/core_progress.py +0 -0
  73. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/persistence/__init__.py +0 -0
  74. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/persistence/core_success.py +0 -0
  75. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/persistence/util_constant.py +0 -0
  76. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/runtime/__init__.py +0 -0
  77. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/stage/__init__.py +0 -0
  78. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/utils/__init__.py +0 -0
  79. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/config.json +0 -0
  80. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/css/_colors.css +0 -0
  81. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/css/dashboard.css +0 -0
  82. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/css/errors.css +0 -0
  83. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/css/inject.css +0 -0
  84. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/favicon.ico +0 -0
  85. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_config.js +0 -0
  86. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/task_topology.js +0 -0
  87. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/js/utils.js +0 -0
  88. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/globals.d.ts +0 -0
  89. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/static/ts/utils.ts +0 -0
  90. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/util_cal.py +0 -0
  91. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow/web/util_error.py +0 -0
  92. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow.egg-info/dependency_links.txt +0 -0
  93. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow.egg-info/entry_points.txt +0 -0
  94. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow.egg-info/requires.txt +0 -0
  95. {celestialflow-3.1.9 → celestialflow-3.2.0}/src/celestialflow.egg-info/top_level.txt +0 -0
  96. {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_queue.py +0 -0
  97. {celestialflow-3.1.9 → celestialflow-3.2.0}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: celestialflow
3
- Version: 3.1.9
3
+ Version: 3.2.0
4
4
  Summary: A flexible GRAPH-based task orchestration framework.
5
5
  Author-email: Mr-xiaotian <mingxiaomingtian@gmail.com>
6
6
  License: MIT
@@ -155,7 +155,7 @@ if __name__ == "__main__":
155
155
 
156
156
  # 构建任务图结构
157
157
  graph = TaskGraph()
158
- graph.set_stages(root_stages=[stage1], stages=[stage2])
158
+ graph.set_stages(stages=[stage1, stage2])
159
159
  graph.connect([stage1], [stage2])
160
160
 
161
161
  # 初始化任务并启动
@@ -261,29 +261,31 @@ flowchart TD
261
261
  <p align="center">
262
262
  <img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/file_structure.svg" alt="FileStructure" />
263
263
  <br/>
264
- <em>celestial-flow 3.1.9</em>
264
+ <em>celestial-flow 3.2.0</em>
265
265
  </p>
266
266
 
267
267
  (该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
268
268
 
269
269
  ## 版本日志(Version Log)
270
- - 3.1.9
271
- - feat:
272
- - [Important] 在TaskStage中允许使用 `async` executor_mode;
273
- - 3.1.8版本中其实已经可以实现, 在3.1.9版本中彻底测试通过;
274
- - [Important] 创建基类BaseObservor, 现在可以从外界接入自定义Observor来检测运行状况;
275
- - 同时创建轻量观察者CallbackObserver;
276
- - 在TaskStage中添加init字段`log_level`, 自此stage init字段集实现对executor init字段集的包含关系, 仅多出`stage_mode`字段;
277
- - escapeHtml中添加更多替换项;
278
- - 在dispatch_thread中添加对futures的清理, 避免无用future的堆积;
279
- - 基于bench\bench_futures_memory.py, 在十万级任务下futures内存开销为177.01 MB, 在定期清理后则为0.48 MB
280
- - refactor:
281
- - 重构TaskProgress, 使其继承BaseObservor;
282
- - 接口破坏性重构, TaskExecutor的show_progress参数已删除, 现在只有显性的add_observer TaskProgress后才会使用progress
283
- - 具体使用参考demo\demo_executor.py
284
- - 重构TaskEnvelope, 不再使用wrap与unwrap, 同时hash值惰性求解;
285
- - chore:
286
- - 删除部分无用代码以提高代码质量;
270
+ - 3.2.0
271
+ - feat:
272
+ - [Important] 彻底废弃 `stage_mode="process"`, 移除所有 multiprocessing 依赖(MPValue, MPQueue, multiprocessing.Process);
273
+ - bench_graph_mode 数据表明 process 模式在所有场景下均慢于 thread 模式, 且引入大量序列化开销和 pickle 限制;
274
+ - [Important] 删除原有set_stages中手动输入的`root_stages`参数, 取而代之为通过scc缩合图计算出的一组`source_stages`
275
+ - 重补了不少图论课
276
+ - 将graph/stage/executor的默认log level从`SUCCESS`改为`INFO`, 也就是默认只显示开启关闭信息与错误
277
+ - 在web页面中添加配置按钮
278
+ - 当前仅支持设置刷新间隔与历史长度, 之后可以进行更多设置
279
+ - refactor:
280
+ - 由于stage_mode中取消`process`, 框架中部分为了适配`process`而进行的设计进行删除或者重构
281
+ - 例如将所有的MPValue和MPQueue改为int与Queue
282
+ - 尚未进行严格的bench测试, 但应该会带来一定的性能优化
283
+ - 重构networkx图的建立过程, 现在直接通过节点与出边进行建立, 不再依赖递归
284
+ - 在重试检测机制中计算bytes类型的hash, 而非原本的string类型
285
+ - 根据 bench_hash_memory, 节省内存约23%
286
+ - 将节点状态中的deltas数据放在web端由js计算, 减少不必要的通信数据
287
+ - fix:
288
+ - 删除InQueue.get中的错误捕获, 这会导致错过panic级error
287
289
 
288
290
  更多过往日志可看:
289
291
 
@@ -130,7 +130,7 @@ if __name__ == "__main__":
130
130
 
131
131
  # 构建任务图结构
132
132
  graph = TaskGraph()
133
- graph.set_stages(root_stages=[stage1], stages=[stage2])
133
+ graph.set_stages(stages=[stage1, stage2])
134
134
  graph.connect([stage1], [stage2])
135
135
 
136
136
  # 初始化任务并启动
@@ -236,29 +236,31 @@ flowchart TD
236
236
  <p align="center">
237
237
  <img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/file_structure.svg" alt="FileStructure" />
238
238
  <br/>
239
- <em>celestial-flow 3.1.9</em>
239
+ <em>celestial-flow 3.2.0</em>
240
240
  </p>
241
241
 
242
242
  (该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
243
243
 
244
244
  ## 版本日志(Version Log)
245
- - 3.1.9
246
- - feat:
247
- - [Important] 在TaskStage中允许使用 `async` executor_mode;
248
- - 3.1.8版本中其实已经可以实现, 在3.1.9版本中彻底测试通过;
249
- - [Important] 创建基类BaseObservor, 现在可以从外界接入自定义Observor来检测运行状况;
250
- - 同时创建轻量观察者CallbackObserver;
251
- - 在TaskStage中添加init字段`log_level`, 自此stage init字段集实现对executor init字段集的包含关系, 仅多出`stage_mode`字段;
252
- - escapeHtml中添加更多替换项;
253
- - 在dispatch_thread中添加对futures的清理, 避免无用future的堆积;
254
- - 基于bench\bench_futures_memory.py, 在十万级任务下futures内存开销为177.01 MB, 在定期清理后则为0.48 MB
255
- - refactor:
256
- - 重构TaskProgress, 使其继承BaseObservor;
257
- - 接口破坏性重构, TaskExecutor的show_progress参数已删除, 现在只有显性的add_observer TaskProgress后才会使用progress
258
- - 具体使用参考demo\demo_executor.py
259
- - 重构TaskEnvelope, 不再使用wrap与unwrap, 同时hash值惰性求解;
260
- - chore:
261
- - 删除部分无用代码以提高代码质量;
245
+ - 3.2.0
246
+ - feat:
247
+ - [Important] 彻底废弃 `stage_mode="process"`, 移除所有 multiprocessing 依赖(MPValue, MPQueue, multiprocessing.Process);
248
+ - bench_graph_mode 数据表明 process 模式在所有场景下均慢于 thread 模式, 且引入大量序列化开销和 pickle 限制;
249
+ - [Important] 删除原有set_stages中手动输入的`root_stages`参数, 取而代之为通过scc缩合图计算出的一组`source_stages`
250
+ - 重补了不少图论课
251
+ - 将graph/stage/executor的默认log level从`SUCCESS`改为`INFO`, 也就是默认只显示开启关闭信息与错误
252
+ - 在web页面中添加配置按钮
253
+ - 当前仅支持设置刷新间隔与历史长度, 之后可以进行更多设置
254
+ - refactor:
255
+ - 由于stage_mode中取消`process`, 框架中部分为了适配`process`而进行的设计进行删除或者重构
256
+ - 例如将所有的MPValue和MPQueue改为int与Queue
257
+ - 尚未进行严格的bench测试, 但应该会带来一定的性能优化
258
+ - 重构networkx图的建立过程, 现在直接通过节点与出边进行建立, 不再依赖递归
259
+ - 在重试检测机制中计算bytes类型的hash, 而非原本的string类型
260
+ - 根据 bench_hash_memory, 节省内存约23%
261
+ - 将节点状态中的deltas数据放在web端由js计算, 减少不必要的通信数据
262
+ - fix:
263
+ - 删除InQueue.get中的错误捕获, 这会导致错过panic级error
262
264
 
263
265
  更多过往日志可看:
264
266
 
@@ -1,81 +1,80 @@
1
- [build-system]
2
- requires = ["setuptools>=61.0", "wheel"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "celestialflow"
7
- version = "3.1.9"
8
- description = "A flexible GRAPH-based task orchestration framework."
9
- readme = "README.md"
10
- license = { text = "MIT" }
11
- authors = [{ name = "Mr-xiaotian", email = "mingxiaomingtian@gmail.com" }]
12
- keywords = ["workflow", "task", "graph", "async", "CelestialFlow"]
13
- requires-python = ">=3.10"
14
-
15
- dependencies = [
16
- "tqdm",
17
- "fastapi",
18
- "uvicorn",
19
- "requests",
20
- "networkx",
21
- "redis",
22
- "jinja2",
23
- "celestialtree>=0.1.2",
24
- ]
25
-
26
- classifiers = [
27
- "Programming Language :: Python :: 3",
28
- "License :: OSI Approved :: MIT License",
29
- "Operating System :: OS Independent",
30
- "Framework :: FastAPI",
31
- "Topic :: Software Development :: Libraries",
32
- ]
33
-
34
- [project.urls]
35
- "Homepage" = "https://github.com/Mr-xiaotian/CelestialFlow"
36
- "Bug Tracker" = "https://github.com/Mr-xiaotian/CelestialFlow/issues"
37
-
38
- [project.scripts]
39
- celestialflow-web = "celestialflow.web.core_server:main_entry"
40
-
41
- [tool.setuptools]
42
- license-files = []
43
-
44
- [tool.setuptools.package-data]
45
- celestialflow = [
46
- "web/templates/**/*.html",
47
- "web/static/**/*",
48
- "web/config.json"
49
- ]
50
-
51
- [tool.pytest.ini_options]
52
- addopts = "-s"
53
- log_cli = true
54
- log_cli_level = "INFO"
55
- log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
56
- log_cli_date_format = "%Y-%m-%d %H:%M:%S"
57
-
58
- filterwarnings = [
59
- "ignore::DeprecationWarning",
60
- "ignore::pytest.PytestDeprecationWarning",
61
- ]
62
-
63
- asyncio_default_fixture_loop_scope = "function"
64
-
65
- [dependency-groups]
66
- dev = [
67
- "build>=1.2.2.post1",
68
- "twine>=6.1.0",
69
- "pytest>=8.3.4",
70
- "pytest-asyncio>=0.25.3",
71
- "httpx>=0.28.1",
72
- "python-dotenv>=1.2.2",
73
- "dill",
74
- "mypy>=1.19.1",
75
- "ruff",
76
- ]
77
-
78
- [tool.mypy]
79
- python_version = "3.10"
80
- no_implicit_optional = false
81
- disable_error_code = ["import-untyped"]
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "celestialflow"
7
+ version = "3.2.0"
8
+ description = "A flexible GRAPH-based task orchestration framework."
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ authors = [{ name = "Mr-xiaotian", email = "mingxiaomingtian@gmail.com" }]
12
+ keywords = ["workflow", "task", "graph", "async", "CelestialFlow"]
13
+ requires-python = ">=3.10"
14
+
15
+ dependencies = [
16
+ "tqdm",
17
+ "fastapi",
18
+ "uvicorn",
19
+ "requests",
20
+ "networkx",
21
+ "redis",
22
+ "jinja2",
23
+ "celestialtree>=0.1.2",
24
+ ]
25
+
26
+ classifiers = [
27
+ "Programming Language :: Python :: 3",
28
+ "License :: OSI Approved :: MIT License",
29
+ "Operating System :: OS Independent",
30
+ "Framework :: FastAPI",
31
+ "Topic :: Software Development :: Libraries",
32
+ ]
33
+
34
+ [project.urls]
35
+ "Homepage" = "https://github.com/Mr-xiaotian/CelestialFlow"
36
+ "Bug Tracker" = "https://github.com/Mr-xiaotian/CelestialFlow/issues"
37
+
38
+ [project.scripts]
39
+ celestialflow-web = "celestialflow.web.core_server:main_entry"
40
+
41
+ [tool.setuptools]
42
+ license-files = []
43
+
44
+ [tool.setuptools.package-data]
45
+ celestialflow = [
46
+ "web/templates/**/*.html",
47
+ "web/static/**/*",
48
+ "web/config.json"
49
+ ]
50
+
51
+ [tool.pytest.ini_options]
52
+ addopts = "-s"
53
+ log_cli = true
54
+ log_cli_level = "INFO"
55
+ log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
56
+ log_cli_date_format = "%Y-%m-%d %H:%M:%S"
57
+
58
+ filterwarnings = [
59
+ "ignore::DeprecationWarning",
60
+ "ignore::pytest.PytestDeprecationWarning",
61
+ ]
62
+
63
+ asyncio_default_fixture_loop_scope = "function"
64
+
65
+ [dependency-groups]
66
+ dev = [
67
+ "build>=1.2.2.post1",
68
+ "twine>=6.1.0",
69
+ "pytest>=8.3.4",
70
+ "pytest-asyncio>=0.25.3",
71
+ "httpx>=0.28.1",
72
+ "python-dotenv>=1.2.2",
73
+ "ruff>=0.15.0",
74
+ "pyright>=1.1.409",
75
+ ]
76
+
77
+ [tool.pyright]
78
+ include = ["src"]
79
+ strict = ["src/celestialflow/runtime", "src/celestialflow/stage", "src/celestialflow/graph", "src/celestialflow/persistence", "src/celestialflow/funnel", "src/celestialflow/observability", "src/celestialflow/utils"]
80
+ stubsPath = "typings"
@@ -1,12 +1,10 @@
1
1
  # funnel/core_spout.py
2
2
  from __future__ import annotations
3
3
 
4
- from multiprocessing import Queue as MPQueue
5
- from queue import Empty
4
+ from queue import Empty, Queue
6
5
  from threading import Thread
7
6
  from typing import Any
8
7
 
9
- from ..runtime.util_queue import cleanup_mpqueue
10
8
  from ..runtime.util_types import TERMINATION_SIGNAL, TerminationSignal
11
9
 
12
10
 
@@ -15,7 +13,7 @@ class BaseSpout:
15
13
 
16
14
  def __init__(self) -> None:
17
15
  """初始化监听器及其内部队列和线程引用。"""
18
- self.queue: Any = MPQueue()
16
+ self.queue: Queue[Any] = Queue()
19
17
  self._thread: Thread | None = None
20
18
 
21
19
  def _before_start(self) -> None:
@@ -46,7 +44,7 @@ class BaseSpout:
46
44
  except Exception: # ← 新增:防止线程崩溃
47
45
  continue # 或记录到 stderr,至少不丢后续记录
48
46
 
49
- def get_queue(self) -> MPQueue:
47
+ def get_queue(self) -> Queue[Any]:
50
48
  """获取监听器的输入队列。"""
51
49
  return self.queue
52
50
 
@@ -58,5 +56,4 @@ class BaseSpout:
58
56
  self.queue.put(TERMINATION_SIGNAL)
59
57
  self._thread.join()
60
58
  self._thread = None
61
- cleanup_mpqueue(self.queue)
62
59
  self._after_stop()