celestialflow 3.1.0__tar.gz → 3.1.1__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 (42) hide show
  1. {celestialflow-3.1.0 → celestialflow-3.1.1}/PKG-INFO +32 -96
  2. {celestialflow-3.1.0 → celestialflow-3.1.1}/README.md +31 -95
  3. {celestialflow-3.1.0 → celestialflow-3.1.1}/pyproject.toml +66 -60
  4. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/static/js/utils.js +1 -1
  5. celestialflow-3.1.1/src/celestialflow/task_errors.py +78 -0
  6. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/task_executor.py +64 -60
  7. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/task_graph.py +131 -91
  8. celestialflow-3.1.0/src/celestialflow/task_logging.py → celestialflow-3.1.1/src/celestialflow/task_logger.py +18 -22
  9. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/task_nodes.py +5 -6
  10. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/task_queue.py +63 -25
  11. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/task_report.py +29 -20
  12. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/task_stage.py +18 -18
  13. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/task_structure.py +33 -12
  14. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/task_tools.py +125 -47
  15. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/task_types.py +9 -2
  16. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow.egg-info/PKG-INFO +32 -96
  17. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow.egg-info/SOURCES.txt +2 -1
  18. {celestialflow-3.1.0 → celestialflow-3.1.1}/tests/test_graph.py +17 -6
  19. {celestialflow-3.1.0 → celestialflow-3.1.1}/tests/test_nodes.py +10 -5
  20. {celestialflow-3.1.0 → celestialflow-3.1.1}/tests/test_structure.py +43 -35
  21. {celestialflow-3.1.0 → celestialflow-3.1.1}/setup.cfg +0 -0
  22. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/__init__.py +0 -0
  23. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/static/css/base.css +0 -0
  24. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/static/css/dashboard.css +0 -0
  25. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/static/css/errors.css +0 -0
  26. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/static/css/inject.css +0 -0
  27. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/static/favicon.ico +0 -0
  28. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/static/js/main.js +0 -0
  29. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/static/js/task_errors.js +0 -0
  30. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/static/js/task_injection.js +0 -0
  31. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/static/js/task_statuses.js +0 -0
  32. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/static/js/task_structure.js +0 -0
  33. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/static/js/task_summary.js +0 -0
  34. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/static/js/task_topology.js +0 -0
  35. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/task_progress.py +0 -0
  36. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/task_web.py +0 -0
  37. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow/templates/index.html +0 -0
  38. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow.egg-info/dependency_links.txt +0 -0
  39. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow.egg-info/entry_points.txt +0 -0
  40. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow.egg-info/requires.txt +0 -0
  41. {celestialflow-3.1.0 → celestialflow-3.1.1}/src/celestialflow.egg-info/top_level.txt +0 -0
  42. {celestialflow-3.1.0 → celestialflow-3.1.1}/tests/test_executor.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: celestialflow
3
- Version: 3.1.0
3
+ Version: 3.1.1
4
4
  Summary: A flexible GRAPH-based task orchestration framework.
5
5
  Author-email: Mr-xiaotian <mingxiaomingtian@gmail.com>
6
6
  License: MIT
@@ -130,7 +130,11 @@ flowchart LR
130
130
  安装 CelestialFlow:
131
131
 
132
132
  ```bash
133
- pip install celestialflow
133
+ # 推荐使用 `uv` 管理依赖与环境
134
+ uv pip install celestialflow
135
+
136
+ # 不过也可以直接使用 `pip`
137
+ uv pip install celestialflow
134
138
  ```
135
139
 
136
140
  一个简单的可运行代码:
@@ -202,6 +206,7 @@ flowchart TD
202
206
  - [TaskTools](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_tools.md)
203
207
  - [TaskTypes](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_types.md)
204
208
  - [TaskLogging](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_logging.md)
209
+ - [TaskErrors](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_errors.md)
205
210
 
206
211
  如果你更喜欢通过完整案例理解框架的运行方式,可以参考这篇从零开始构建 TaskGraph 的教程:
207
212
 
@@ -231,100 +236,13 @@ flowchart TD
231
236
 
232
237
  ## 文件结构(File Structure)
233
238
 
234
- ```
235
- 📁 CelestialFlow (224MB 407KB 500B)
236
- 📁 docs (34KB 944B)
237
- 📁 reference (29KB 995B)
238
- 📝 ctree_client.md (6KB 997B)
239
- 📝 go_worker.md (6KB 378B)
240
- 📝 task_graph.md (4KB 989B)
241
- 📝 task_logging.md (0B)
242
- 📝 task_manage.md (7KB 499B)
243
- 📝 task_nodes.md (4KB 68B)
244
- 📝 task_progress.md (0B)
245
- 📝 task_queue.md (0B)
246
- 📝 task_report.md (0B)
247
- 📝 task_stage.md (0B)
248
- 📝 task_structure.md (112B)
249
- 📝 task_tools.md (0B)
250
- 📝 task_types.md (0B)
251
- 📝 task_web.md (0B)
252
- 📝 quick_start.md (4KB 973B)
253
- 📝 tutorial.md (0B)
254
- 📁 experiments (15KB 111B)
255
- 🐍 benchmark_datastructures.py (6KB 52B)
256
- 🐍 benchmark_hash.py (1KB 284B)
257
- 🐍 benchmark_queue.py (5KB 504B)
258
- 🐍 benchmark_tqdm.py (1KB 160B)
259
- 🐍 experiment_tqdm.py (1KB 135B)
260
- 📁 go_worker (6MB 968KB 38B)
261
- 📁 worker (5KB 746B)
262
- 🌀 parser.go (394B)
263
- 🌀 processor.go (2KB 612B)
264
- 🌀 types.go (299B)
265
- 🌀 worker.go (2KB 465B)
266
- ❓ go.mod (292B)
267
- ❓ go.sum (1KB 68B)
268
- ❓ go_worker.exe (6MB 960KB)
269
- 🌀 main.go (980B)
270
- 📁 img (4MB 700KB 695B)
271
- 📷 logo(old).png (836KB 542B)
272
- 📷 logo.png (122KB 747B)
273
- 📷 web_display.png (129KB 545B)
274
- 🎞️ web_ui.gif (3MB 635KB 909B)
275
- 📁 src (1MB 929KB 111B)
276
- 📁 celestialflow (1MB 911KB 486B)
277
- 📁 static (1MB 417KB 367B)
278
- 📁 css (31KB 621B)
279
- 🎨 base.css (6KB 181B)
280
- 🎨 dashboard.css (7KB 414B)
281
- 🎨 errors.css (5KB 216B)
282
- 🎨 inject.css (12KB 834B)
283
- 📁 js (33KB 672B)
284
- 📜 main.js (5KB 65B)
285
- 📜 task_errors.js (4KB 595B)
286
- 📜 task_injection.js (8KB 484B)
287
- 📜 task_statuses.js (8KB 51B)
288
- 📜 task_structure.js (4KB 709B)
289
- 📜 task_topology.js (1KB 375B)
290
- 📜 utils.js (1KB 441B)
291
- ❓ favicon.ico (1MB 352KB 98B)
292
- 📁 templates (13KB 174B)
293
- 🌐 index.html (13KB 174B)
294
- 📁 [1项排除的目录] (339KB 553B)
295
- 🐍 task_graph.py (26KB 700B)
296
- 🐍 task_logging.py (10KB 282B)
297
- 🐍 task_manage.py (36KB 110B)
298
- 🐍 task_nodes.py (10KB 814B)
299
- 🐍 task_progress.py (1KB 477B)
300
- 🐍 task_queue.py (10KB 948B)
301
- 🐍 task_report.py (4KB 828B)
302
- 🐍 task_stage.py (6KB 577B)
303
- 🐍 task_structure.py (7KB 255B)
304
- 🐍 task_tools.py (17KB 19B)
305
- 🐍 task_types.py (2KB 269B)
306
- 🐍 task_web.py (6KB 235B)
307
- 🐍 __init__.py (1KB 22B)
308
- 📁 [1项排除的目录] (17KB 649B)
309
- 📁 tests (126KB 724B)
310
- 📁 [1项排除的目录] (90KB 464B)
311
- 🐍 conftest.py (49B)
312
- 📝 README.md (6KB 324B)
313
- 🐍 test_graph.py (5KB 547B)
314
- 🐍 test_manage.py (3KB 90B)
315
- 🐍 test_nodes.py (11KB 218B)
316
- 🐍 test_structure.py (10KB 56B)
317
- 📁 [6项排除的目录] (210MB 685KB 450B)
318
- ❓ .env (88B)
319
- ❓ .gitignore (272B)
320
- ❓ LICENSE (1KB 65B)
321
- ❓ Makefile (501B)
322
- ❓ pyproject.toml (1KB 594B)
323
- 📝 README.md (16KB 3B)
324
- (celestial-flow 3.0.9)
325
- ```
239
+ <p align="center">
240
+ <img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/file_structure.svg" alt="FileStructure" />
241
+ <br/>
242
+ <em>celestial-flow 3.1.1</em>
243
+ </p>
326
244
 
327
- (该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。)
245
+ (该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
328
246
 
329
247
  ## 更新日志(Change Log)
330
248
 
@@ -353,7 +271,25 @@ flowchart TD
353
271
  - 增加大量warning与error, 用于提醒不规范设置;
354
272
  - 优化前后端中错误数据的传输方式, 在大量错误数据时减少内存消耗;
355
273
  - 优化TaskLogger中log队列的准入机制;
356
- - 修改部分Bug
274
+ - 修改部分Bug;
275
+ - 3.1.0:
276
+ - 新增:
277
+ - 优化web端仪表盘页面的"总体状态摘要"卡片, 新增"总重复任务"与"总剩余市场", 后者由节点间拓扑关系计算而成, 后续还需要优化;
278
+ - 修复:
279
+ - 3.0.9版本下当web端与celestialflow运行端不同时, error数据无法传递的问题;
280
+ - 修复NullTaskReporter使用问题;
281
+ - 3.1.1:
282
+ - 新增:
283
+ - [Important] CelestialTree中引入grpc, 这大大减少了emit操作的耗时;
284
+ - [Important] 为TerminationSignal添加id, 并可以像task一样通过CelestialTree进行跟踪;
285
+ - 优化task_graph与task_executor的log分级, 现在默认为"SUCCESS"级;
286
+ - 将go_worker部分分离为单独project: [celestialflow-goworker]https://github.com/Mr-xiaotian/celestialflow-goworker
287
+ - 在readme中使用svg图片来展示文件夹结构;
288
+ - 优化全局剩余时间的计算;
289
+ - 优化部分代码结构;
290
+ - 修复:
291
+ - 修复节点剩余时间在小于1s时显示0的问题(这很影响判断);
292
+ - 在task_graph中使用"staged"模式时会报错的问题;
357
293
 
358
294
  ## Star 历史趋势(Star History)
359
295
 
@@ -104,7 +104,11 @@ flowchart LR
104
104
  安装 CelestialFlow:
105
105
 
106
106
  ```bash
107
- pip install celestialflow
107
+ # 推荐使用 `uv` 管理依赖与环境
108
+ uv pip install celestialflow
109
+
110
+ # 不过也可以直接使用 `pip`
111
+ uv pip install celestialflow
108
112
  ```
109
113
 
110
114
  一个简单的可运行代码:
@@ -176,6 +180,7 @@ flowchart TD
176
180
  - [TaskTools](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_tools.md)
177
181
  - [TaskTypes](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_types.md)
178
182
  - [TaskLogging](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_logging.md)
183
+ - [TaskErrors](https://github.com/Mr-xiaotian/CelestialFlow/blob/main/docs/reference/task_errors.md)
179
184
 
180
185
  如果你更喜欢通过完整案例理解框架的运行方式,可以参考这篇从零开始构建 TaskGraph 的教程:
181
186
 
@@ -205,100 +210,13 @@ flowchart TD
205
210
 
206
211
  ## 文件结构(File Structure)
207
212
 
208
- ```
209
- 📁 CelestialFlow (224MB 407KB 500B)
210
- 📁 docs (34KB 944B)
211
- 📁 reference (29KB 995B)
212
- 📝 ctree_client.md (6KB 997B)
213
- 📝 go_worker.md (6KB 378B)
214
- 📝 task_graph.md (4KB 989B)
215
- 📝 task_logging.md (0B)
216
- 📝 task_manage.md (7KB 499B)
217
- 📝 task_nodes.md (4KB 68B)
218
- 📝 task_progress.md (0B)
219
- 📝 task_queue.md (0B)
220
- 📝 task_report.md (0B)
221
- 📝 task_stage.md (0B)
222
- 📝 task_structure.md (112B)
223
- 📝 task_tools.md (0B)
224
- 📝 task_types.md (0B)
225
- 📝 task_web.md (0B)
226
- 📝 quick_start.md (4KB 973B)
227
- 📝 tutorial.md (0B)
228
- 📁 experiments (15KB 111B)
229
- 🐍 benchmark_datastructures.py (6KB 52B)
230
- 🐍 benchmark_hash.py (1KB 284B)
231
- 🐍 benchmark_queue.py (5KB 504B)
232
- 🐍 benchmark_tqdm.py (1KB 160B)
233
- 🐍 experiment_tqdm.py (1KB 135B)
234
- 📁 go_worker (6MB 968KB 38B)
235
- 📁 worker (5KB 746B)
236
- 🌀 parser.go (394B)
237
- 🌀 processor.go (2KB 612B)
238
- 🌀 types.go (299B)
239
- 🌀 worker.go (2KB 465B)
240
- ❓ go.mod (292B)
241
- ❓ go.sum (1KB 68B)
242
- ❓ go_worker.exe (6MB 960KB)
243
- 🌀 main.go (980B)
244
- 📁 img (4MB 700KB 695B)
245
- 📷 logo(old).png (836KB 542B)
246
- 📷 logo.png (122KB 747B)
247
- 📷 web_display.png (129KB 545B)
248
- 🎞️ web_ui.gif (3MB 635KB 909B)
249
- 📁 src (1MB 929KB 111B)
250
- 📁 celestialflow (1MB 911KB 486B)
251
- 📁 static (1MB 417KB 367B)
252
- 📁 css (31KB 621B)
253
- 🎨 base.css (6KB 181B)
254
- 🎨 dashboard.css (7KB 414B)
255
- 🎨 errors.css (5KB 216B)
256
- 🎨 inject.css (12KB 834B)
257
- 📁 js (33KB 672B)
258
- 📜 main.js (5KB 65B)
259
- 📜 task_errors.js (4KB 595B)
260
- 📜 task_injection.js (8KB 484B)
261
- 📜 task_statuses.js (8KB 51B)
262
- 📜 task_structure.js (4KB 709B)
263
- 📜 task_topology.js (1KB 375B)
264
- 📜 utils.js (1KB 441B)
265
- ❓ favicon.ico (1MB 352KB 98B)
266
- 📁 templates (13KB 174B)
267
- 🌐 index.html (13KB 174B)
268
- 📁 [1项排除的目录] (339KB 553B)
269
- 🐍 task_graph.py (26KB 700B)
270
- 🐍 task_logging.py (10KB 282B)
271
- 🐍 task_manage.py (36KB 110B)
272
- 🐍 task_nodes.py (10KB 814B)
273
- 🐍 task_progress.py (1KB 477B)
274
- 🐍 task_queue.py (10KB 948B)
275
- 🐍 task_report.py (4KB 828B)
276
- 🐍 task_stage.py (6KB 577B)
277
- 🐍 task_structure.py (7KB 255B)
278
- 🐍 task_tools.py (17KB 19B)
279
- 🐍 task_types.py (2KB 269B)
280
- 🐍 task_web.py (6KB 235B)
281
- 🐍 __init__.py (1KB 22B)
282
- 📁 [1项排除的目录] (17KB 649B)
283
- 📁 tests (126KB 724B)
284
- 📁 [1项排除的目录] (90KB 464B)
285
- 🐍 conftest.py (49B)
286
- 📝 README.md (6KB 324B)
287
- 🐍 test_graph.py (5KB 547B)
288
- 🐍 test_manage.py (3KB 90B)
289
- 🐍 test_nodes.py (11KB 218B)
290
- 🐍 test_structure.py (10KB 56B)
291
- 📁 [6项排除的目录] (210MB 685KB 450B)
292
- ❓ .env (88B)
293
- ❓ .gitignore (272B)
294
- ❓ LICENSE (1KB 65B)
295
- ❓ Makefile (501B)
296
- ❓ pyproject.toml (1KB 594B)
297
- 📝 README.md (16KB 3B)
298
- (celestial-flow 3.0.9)
299
- ```
213
+ <p align="center">
214
+ <img src="https://raw.githubusercontent.com/Mr-xiaotian/CelestialFlow/main/img/file_structure.svg" alt="FileStructure" />
215
+ <br/>
216
+ <em>celestial-flow 3.1.1</em>
217
+ </p>
300
218
 
301
- (该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。)
219
+ (该视图由我的另一个项目[CelestialVault](https://github.com/Mr-xiaotian/CelestialVault)中inst_file.FileTree.print_tree()生成。转换为图片则借助[Carbon](https://carbon.now.sh)。)
302
220
 
303
221
  ## 更新日志(Change Log)
304
222
 
@@ -327,7 +245,25 @@ flowchart TD
327
245
  - 增加大量warning与error, 用于提醒不规范设置;
328
246
  - 优化前后端中错误数据的传输方式, 在大量错误数据时减少内存消耗;
329
247
  - 优化TaskLogger中log队列的准入机制;
330
- - 修改部分Bug
248
+ - 修改部分Bug;
249
+ - 3.1.0:
250
+ - 新增:
251
+ - 优化web端仪表盘页面的"总体状态摘要"卡片, 新增"总重复任务"与"总剩余市场", 后者由节点间拓扑关系计算而成, 后续还需要优化;
252
+ - 修复:
253
+ - 3.0.9版本下当web端与celestialflow运行端不同时, error数据无法传递的问题;
254
+ - 修复NullTaskReporter使用问题;
255
+ - 3.1.1:
256
+ - 新增:
257
+ - [Important] CelestialTree中引入grpc, 这大大减少了emit操作的耗时;
258
+ - [Important] 为TerminationSignal添加id, 并可以像task一样通过CelestialTree进行跟踪;
259
+ - 优化task_graph与task_executor的log分级, 现在默认为"SUCCESS"级;
260
+ - 将go_worker部分分离为单独project: [celestialflow-goworker]https://github.com/Mr-xiaotian/celestialflow-goworker
261
+ - 在readme中使用svg图片来展示文件夹结构;
262
+ - 优化全局剩余时间的计算;
263
+ - 优化部分代码结构;
264
+ - 修复:
265
+ - 修复节点剩余时间在小于1s时显示0的问题(这很影响判断);
266
+ - 在task_graph中使用"staged"模式时会报错的问题;
331
267
 
332
268
  ## Star 历史趋势(Star History)
333
269
 
@@ -1,60 +1,66 @@
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.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.8"
14
-
15
- dependencies = [
16
- "tqdm",
17
- "loguru",
18
- "fastapi",
19
- "uvicorn",
20
- "requests",
21
- "networkx",
22
- "redis",
23
- "jinja2",
24
- "celestialtree",
25
- ]
26
-
27
- classifiers = [
28
- "Programming Language :: Python :: 3",
29
- "License :: OSI Approved :: MIT License",
30
- "Operating System :: OS Independent",
31
- "Framework :: FastAPI",
32
- "Topic :: Software Development :: Libraries",
33
- ]
34
-
35
- [project.urls]
36
- "Homepage" = "https://github.com/Mr-xiaotian/CelestialFlow"
37
- "Bug Tracker" = "https://github.com/Mr-xiaotian/CelestialFlow/issues"
38
-
39
- [project.scripts]
40
- celestialflow-web = "celestialflow.task_web:main_entry"
41
-
42
- [tool.setuptools]
43
- license-files = []
44
-
45
- [tool.setuptools.package-data]
46
- "celestialflow" = ["templates/*.html", "static/**/*"]
47
-
48
- [tool.pytest.ini_options]
49
- addopts = "-s"
50
- log_cli = true
51
- log_cli_level = "INFO"
52
- log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
53
- log_cli_date_format = "%Y-%m-%d %H:%M:%S"
54
-
55
- filterwarnings = [
56
- "ignore::DeprecationWarning",
57
- "ignore::pytest.PytestDeprecationWarning",
58
- ]
59
-
60
- asyncio_default_fixture_loop_scope = "function"
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.1"
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.8"
14
+
15
+ dependencies = [
16
+ "tqdm",
17
+ "loguru",
18
+ "fastapi",
19
+ "uvicorn",
20
+ "requests",
21
+ "networkx",
22
+ "redis",
23
+ "jinja2",
24
+ "celestialtree",
25
+ ]
26
+
27
+ classifiers = [
28
+ "Programming Language :: Python :: 3",
29
+ "License :: OSI Approved :: MIT License",
30
+ "Operating System :: OS Independent",
31
+ "Framework :: FastAPI",
32
+ "Topic :: Software Development :: Libraries",
33
+ ]
34
+
35
+ [project.urls]
36
+ "Homepage" = "https://github.com/Mr-xiaotian/CelestialFlow"
37
+ "Bug Tracker" = "https://github.com/Mr-xiaotian/CelestialFlow/issues"
38
+
39
+ [project.scripts]
40
+ celestialflow-web = "celestialflow.task_web:main_entry"
41
+
42
+ [tool.setuptools]
43
+ license-files = []
44
+
45
+ [tool.setuptools.package-data]
46
+ "celestialflow" = ["templates/*.html", "static/**/*"]
47
+
48
+ [tool.pytest.ini_options]
49
+ addopts = "-s"
50
+ log_cli = true
51
+ log_cli_level = "INFO"
52
+ log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
53
+ log_cli_date_format = "%Y-%m-%d %H:%M:%S"
54
+
55
+ filterwarnings = [
56
+ "ignore::DeprecationWarning",
57
+ "ignore::pytest.PytestDeprecationWarning",
58
+ ]
59
+
60
+ asyncio_default_fixture_loop_scope = "function"
61
+
62
+ [dependency-groups]
63
+ dev = [
64
+ "build>=1.2.2.post1",
65
+ "twine>=6.1.0",
66
+ ]
@@ -65,7 +65,7 @@ function toggleDarkTheme() {
65
65
 
66
66
  // task_statuses.js
67
67
  function formatDuration(seconds) {
68
- seconds = Math.floor(seconds);
68
+ seconds = seconds > 0 ? Math.max(1, Math.floor(seconds)) : 0;
69
69
 
70
70
  const hours = Math.floor(seconds / 3600);
71
71
  const remainder = seconds % 3600;
@@ -0,0 +1,78 @@
1
+ from __future__ import annotations
2
+ from typing import Iterable, Tuple, Any
3
+
4
+
5
+ class CelestialFlowError(Exception):
6
+ """CelestialFlow 所有自定义异常的基类"""
7
+
8
+ pass
9
+
10
+
11
+ class ConfigurationError(CelestialFlowError):
12
+ """配置错误(参数非法、组合不支持等)"""
13
+
14
+ pass
15
+
16
+
17
+ class InvalidOptionError(ConfigurationError):
18
+ """
19
+ 某个配置项的取值不合法(不在允许集合里)。
20
+ """
21
+
22
+ def __init__(
23
+ self,
24
+ field: str,
25
+ value: Any,
26
+ allowed: Iterable[Any],
27
+ *,
28
+ prefix: str = "Invalid",
29
+ ):
30
+ allowed_tuple: Tuple[Any, ...] = tuple(allowed)
31
+ message = f"{prefix} {field}: {value}. Valid options are {allowed_tuple}."
32
+ super().__init__(message)
33
+
34
+ self.field = field
35
+ self.value = value
36
+ self.allowed = allowed_tuple
37
+
38
+
39
+ class ExecutionModeError(InvalidOptionError):
40
+ """非法的 execution_mode 配置错误"""
41
+
42
+ def __init__(self, execution_mode: str, valid_modes=None):
43
+ valid_modes = valid_modes or ("serial", "process", "thread", "async")
44
+ super().__init__("execution mode", execution_mode, valid_modes)
45
+ self.execution_mode = execution_mode
46
+ self.valid_modes = self.allowed # 兼容旧字段名
47
+
48
+
49
+ class StageModeError(InvalidOptionError):
50
+ """非法的 stage_mode 配置错误"""
51
+
52
+ def __init__(self, stage_mode: str, valid_modes=None):
53
+ valid_modes = valid_modes or ("serial", "process")
54
+ super().__init__("stage mode", stage_mode, valid_modes)
55
+ self.stage_mode = stage_mode
56
+ self.valid_modes = self.allowed
57
+
58
+
59
+ class LogLevelError(InvalidOptionError):
60
+ """非法的 log_level 配置错误"""
61
+
62
+ def __init__(self, log_level: str, valid_levels=None):
63
+ valid_levels = valid_levels or (
64
+ "TRACE",
65
+ "DEBUG",
66
+ "SUCCESS",
67
+ "INFO",
68
+ "WARNING",
69
+ "ERROR",
70
+ "CRITICAL",
71
+ )
72
+ super().__init__("log level", log_level, valid_levels)
73
+ self.log_level = log_level
74
+ self.valid_levels = self.allowed
75
+
76
+
77
+ class RemoteWorkerError(CelestialFlowError):
78
+ pass