streamlet-py 0.0.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.
- streamlet_py-0.0.1/LICENSE +21 -0
- streamlet_py-0.0.1/PKG-INFO +217 -0
- streamlet_py-0.0.1/README.md +171 -0
- streamlet_py-0.0.1/pyproject.toml +137 -0
- streamlet_py-0.0.1/src/streamlet/__init__.py +1233 -0
- streamlet_py-0.0.1/tests/__init__.py +0 -0
- streamlet_py-0.0.1/tests/conftest.py +11 -0
- streamlet_py-0.0.1/tests/shared/__init__.py +22 -0
- streamlet_py-0.0.1/tests/shared/data_models.py +103 -0
- streamlet_py-0.0.1/tests/test_composition_funcs.py +153 -0
- streamlet_py-0.0.1/tests/test_conditional.py +151 -0
- streamlet_py-0.0.1/tests/test_context.py +95 -0
- streamlet_py-0.0.1/tests/test_exceptions.py +155 -0
- streamlet_py-0.0.1/tests/test_fan_in.py +80 -0
- streamlet_py-0.0.1/tests/test_fan_out.py +143 -0
- streamlet_py-0.0.1/tests/test_fan_out_in.py +57 -0
- streamlet_py-0.0.1/tests/test_integration.py +219 -0
- streamlet_py-0.0.1/tests/test_node_basics.py +97 -0
- streamlet_py-0.0.1/tests/test_node_decorator.py +141 -0
- streamlet_py-0.0.1/tests/test_parallel_result.py +38 -0
- streamlet_py-0.0.1/tests/test_repeat.py +108 -0
- streamlet_py-0.0.1/tests/test_retry.py +281 -0
- streamlet_py-0.0.1/tests/test_sequential.py +109 -0
- streamlet_py-0.0.1/tests/test_validate_call.py +150 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 12306hujunjie
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: streamlet-py
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: A powerful Python framework for building declarative, concurrent data processing workflows
|
|
5
|
+
Keywords: workflow,data-processing,concurrent,declarative,pipeline
|
|
6
|
+
Author-Email: 12306hujunjie <545512690@qq.com>
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2024 12306hujunjie
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
Classifier: Development Status :: 3 - Alpha
|
|
30
|
+
Classifier: Intended Audience :: Developers
|
|
31
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
+
Classifier: Programming Language :: Python :: 3
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
36
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
37
|
+
Classifier: Topic :: System :: Distributed Computing
|
|
38
|
+
Project-URL: Homepage, https://github.com/12306hujunjie/Streamlet
|
|
39
|
+
Project-URL: Repository, https://github.com/12306hujunjie/Streamlet
|
|
40
|
+
Project-URL: Documentation, https://github.com/12306hujunjie/Streamlet/blob/main/docs/API参考.md
|
|
41
|
+
Project-URL: Bug Tracker, https://github.com/12306hujunjie/Streamlet/issues
|
|
42
|
+
Requires-Python: >=3.10
|
|
43
|
+
Requires-Dist: dependency-injector>=4.48.1
|
|
44
|
+
Requires-Dist: pydantic>=2.11.7
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
|
|
47
|
+
# Streamlet - 智能流式数据处理框架
|
|
48
|
+
|
|
49
|
+
[](https://www.python.org/downloads/)
|
|
50
|
+
[](LICENSE)
|
|
51
|
+
|
|
52
|
+
**声明式数据流处理框架:用方法链表达业务逻辑,框架自动处理异步/同步混合执行、并行调度和重试。**
|
|
53
|
+
|
|
54
|
+
- 🎯 **声明式工作流**:`.then()` `.fan_out_to()` `.fan_in()` `.branch_on()` `.repeat()` 方法链构建数据流
|
|
55
|
+
- 🤖 **智能异步执行**:自动检测 async/sync 函数并选择正确的执行策略,无需手动协调
|
|
56
|
+
- 🔗 **@node 装饰器**:任意函数变为可组合节点,内置 pydantic 类型校验和依赖注入
|
|
57
|
+
- 🛡️ **重试机制**:基于异常分类的可配置指数退避重试
|
|
58
|
+
|
|
59
|
+
## 快速开始
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install streamlet
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from streamlet import node
|
|
67
|
+
|
|
68
|
+
@node
|
|
69
|
+
def double(x: int) -> int:
|
|
70
|
+
return x * 2
|
|
71
|
+
|
|
72
|
+
@node
|
|
73
|
+
def add_ten(x: int) -> int:
|
|
74
|
+
return x + 10
|
|
75
|
+
|
|
76
|
+
result = double.then(add_ten)(5) # 20
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 核心 API
|
|
80
|
+
|
|
81
|
+
| 方法 | 功能 | 示例 |
|
|
82
|
+
|------|------|------|
|
|
83
|
+
| `.then(node)` | 顺序连接 | `a.then(b)(data)` |
|
|
84
|
+
| `.fan_out_to([nodes], executor="thread")` | 并行分发 | `a.fan_out_to([b, c])()` |
|
|
85
|
+
| `.fan_in(aggregator)` | 聚合并行结果 | `flow.fan_in(merge)()` |
|
|
86
|
+
| `.fan_out_in([nodes], agg)` | 扇出 + 聚合 | `a.fan_out_in([b, c], merge)()` |
|
|
87
|
+
| `.branch_on({key: node})` | 条件分支 | `a.branch_on({True: b, False: c})()` |
|
|
88
|
+
| `.repeat(times)` | 重复执行 | `a.repeat(3)(data)` |
|
|
89
|
+
|
|
90
|
+
## 示例
|
|
91
|
+
|
|
92
|
+
### 顺序流:ETL 管道
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
from streamlet import node
|
|
96
|
+
import asyncio
|
|
97
|
+
|
|
98
|
+
@node
|
|
99
|
+
async def fetch_data(source: str) -> dict:
|
|
100
|
+
await asyncio.sleep(0.1)
|
|
101
|
+
return {"value": 100, "source": source}
|
|
102
|
+
|
|
103
|
+
@node
|
|
104
|
+
def validate(data: dict) -> dict:
|
|
105
|
+
if data["value"] <= 0:
|
|
106
|
+
raise ValueError("invalid value")
|
|
107
|
+
return data
|
|
108
|
+
|
|
109
|
+
@node
|
|
110
|
+
def enrich(data: dict) -> dict:
|
|
111
|
+
return {**data, "doubled": data["value"] * 2}
|
|
112
|
+
|
|
113
|
+
pipeline = fetch_data.then(validate).then(enrich)
|
|
114
|
+
|
|
115
|
+
async def main():
|
|
116
|
+
result = await pipeline("db")
|
|
117
|
+
print(result) # {"value": 100, "source": "db", "doubled": 200}
|
|
118
|
+
|
|
119
|
+
asyncio.run(main())
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 并行流:扇出 + 聚合
|
|
123
|
+
|
|
124
|
+
```python
|
|
125
|
+
from streamlet import node
|
|
126
|
+
|
|
127
|
+
@node
|
|
128
|
+
def source(x: int) -> dict:
|
|
129
|
+
return {"value": x}
|
|
130
|
+
|
|
131
|
+
@node
|
|
132
|
+
def multiply(data: dict) -> int:
|
|
133
|
+
return data["value"] * 2
|
|
134
|
+
|
|
135
|
+
@node
|
|
136
|
+
def add_ten(data: dict) -> int:
|
|
137
|
+
return data["value"] + 10
|
|
138
|
+
|
|
139
|
+
@node
|
|
140
|
+
def aggregate(results: dict) -> dict:
|
|
141
|
+
values = [r.result for r in results.values() if r.success]
|
|
142
|
+
return {"total": sum(values), "results": values}
|
|
143
|
+
|
|
144
|
+
workflow = source.fan_out_to([multiply, add_ten], executor="thread").fan_in(aggregate)
|
|
145
|
+
result = workflow(5)
|
|
146
|
+
print(result) # {"total": 25, "results": [10, 15]}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### 条件流:分支路由 + 依赖注入
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
from streamlet import BaseFlowContext, node
|
|
153
|
+
from dependency_injector.wiring import Provide
|
|
154
|
+
|
|
155
|
+
container = BaseFlowContext()
|
|
156
|
+
|
|
157
|
+
@node
|
|
158
|
+
def evaluate(data: dict) -> str:
|
|
159
|
+
return "pass" if data["score"] >= 60 else "fail"
|
|
160
|
+
|
|
161
|
+
@node
|
|
162
|
+
def handle_pass(state: dict = Provide[BaseFlowContext.state]) -> dict:
|
|
163
|
+
return {"result": "pass", "score": state["score"]}
|
|
164
|
+
|
|
165
|
+
@node
|
|
166
|
+
def handle_fail(state: dict = Provide[BaseFlowContext.state]) -> dict:
|
|
167
|
+
return {"result": "fail", "score": state["score"]}
|
|
168
|
+
|
|
169
|
+
container.wire(modules=[__name__])
|
|
170
|
+
container.state()["score"] = 75
|
|
171
|
+
|
|
172
|
+
flow = evaluate.branch_on({"pass": handle_pass, "fail": handle_fail})
|
|
173
|
+
print(flow({"score": 75})) # {"result": "pass", "score": 75}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 重试机制
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
from streamlet import node
|
|
180
|
+
|
|
181
|
+
@node(retry_count=3, retry_delay=0.5, backoff_factor=2.0, enable_retry=True)
|
|
182
|
+
def external_call(x: int) -> int:
|
|
183
|
+
# 失败时自动重试,延迟按 0.5s → 1.0s → 2.0s 指数增长
|
|
184
|
+
return call_external_api(x)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## 开发环境
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
git clone https://github.com/12306hujunjie/Streamlet.git
|
|
191
|
+
cd Streamlet
|
|
192
|
+
|
|
193
|
+
pdm install
|
|
194
|
+
|
|
195
|
+
pdm run pytest # 运行测试
|
|
196
|
+
pdm run pytest --cov=src/streamlet # 覆盖率
|
|
197
|
+
pdm run ruff check src/ tests/ # 代码检查
|
|
198
|
+
pdm run mypy src/streamlet/ # 类型检查
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## 技术栈
|
|
202
|
+
|
|
203
|
+
- **Python 3.10+**
|
|
204
|
+
- **dependency-injector** — 依赖注入与线程安全状态管理
|
|
205
|
+
- **pydantic v2** — 类型校验
|
|
206
|
+
|
|
207
|
+
核心模块:`asyncio` | `threading` | `concurrent.futures`
|
|
208
|
+
|
|
209
|
+
## 文档
|
|
210
|
+
|
|
211
|
+
- [API 参考](docs/API参考.md)
|
|
212
|
+
- [CLAUDE.md](CLAUDE.md) — 开发指南
|
|
213
|
+
- `tests/` — 测试用例与使用示例
|
|
214
|
+
|
|
215
|
+
## 许可证
|
|
216
|
+
|
|
217
|
+
MIT — 详见 [LICENSE](LICENSE)
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Streamlet - 智能流式数据处理框架
|
|
2
|
+
|
|
3
|
+
[](https://www.python.org/downloads/)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
**声明式数据流处理框架:用方法链表达业务逻辑,框架自动处理异步/同步混合执行、并行调度和重试。**
|
|
7
|
+
|
|
8
|
+
- 🎯 **声明式工作流**:`.then()` `.fan_out_to()` `.fan_in()` `.branch_on()` `.repeat()` 方法链构建数据流
|
|
9
|
+
- 🤖 **智能异步执行**:自动检测 async/sync 函数并选择正确的执行策略,无需手动协调
|
|
10
|
+
- 🔗 **@node 装饰器**:任意函数变为可组合节点,内置 pydantic 类型校验和依赖注入
|
|
11
|
+
- 🛡️ **重试机制**:基于异常分类的可配置指数退避重试
|
|
12
|
+
|
|
13
|
+
## 快速开始
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install streamlet
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from streamlet import node
|
|
21
|
+
|
|
22
|
+
@node
|
|
23
|
+
def double(x: int) -> int:
|
|
24
|
+
return x * 2
|
|
25
|
+
|
|
26
|
+
@node
|
|
27
|
+
def add_ten(x: int) -> int:
|
|
28
|
+
return x + 10
|
|
29
|
+
|
|
30
|
+
result = double.then(add_ten)(5) # 20
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 核心 API
|
|
34
|
+
|
|
35
|
+
| 方法 | 功能 | 示例 |
|
|
36
|
+
|------|------|------|
|
|
37
|
+
| `.then(node)` | 顺序连接 | `a.then(b)(data)` |
|
|
38
|
+
| `.fan_out_to([nodes], executor="thread")` | 并行分发 | `a.fan_out_to([b, c])()` |
|
|
39
|
+
| `.fan_in(aggregator)` | 聚合并行结果 | `flow.fan_in(merge)()` |
|
|
40
|
+
| `.fan_out_in([nodes], agg)` | 扇出 + 聚合 | `a.fan_out_in([b, c], merge)()` |
|
|
41
|
+
| `.branch_on({key: node})` | 条件分支 | `a.branch_on({True: b, False: c})()` |
|
|
42
|
+
| `.repeat(times)` | 重复执行 | `a.repeat(3)(data)` |
|
|
43
|
+
|
|
44
|
+
## 示例
|
|
45
|
+
|
|
46
|
+
### 顺序流:ETL 管道
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from streamlet import node
|
|
50
|
+
import asyncio
|
|
51
|
+
|
|
52
|
+
@node
|
|
53
|
+
async def fetch_data(source: str) -> dict:
|
|
54
|
+
await asyncio.sleep(0.1)
|
|
55
|
+
return {"value": 100, "source": source}
|
|
56
|
+
|
|
57
|
+
@node
|
|
58
|
+
def validate(data: dict) -> dict:
|
|
59
|
+
if data["value"] <= 0:
|
|
60
|
+
raise ValueError("invalid value")
|
|
61
|
+
return data
|
|
62
|
+
|
|
63
|
+
@node
|
|
64
|
+
def enrich(data: dict) -> dict:
|
|
65
|
+
return {**data, "doubled": data["value"] * 2}
|
|
66
|
+
|
|
67
|
+
pipeline = fetch_data.then(validate).then(enrich)
|
|
68
|
+
|
|
69
|
+
async def main():
|
|
70
|
+
result = await pipeline("db")
|
|
71
|
+
print(result) # {"value": 100, "source": "db", "doubled": 200}
|
|
72
|
+
|
|
73
|
+
asyncio.run(main())
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 并行流:扇出 + 聚合
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
from streamlet import node
|
|
80
|
+
|
|
81
|
+
@node
|
|
82
|
+
def source(x: int) -> dict:
|
|
83
|
+
return {"value": x}
|
|
84
|
+
|
|
85
|
+
@node
|
|
86
|
+
def multiply(data: dict) -> int:
|
|
87
|
+
return data["value"] * 2
|
|
88
|
+
|
|
89
|
+
@node
|
|
90
|
+
def add_ten(data: dict) -> int:
|
|
91
|
+
return data["value"] + 10
|
|
92
|
+
|
|
93
|
+
@node
|
|
94
|
+
def aggregate(results: dict) -> dict:
|
|
95
|
+
values = [r.result for r in results.values() if r.success]
|
|
96
|
+
return {"total": sum(values), "results": values}
|
|
97
|
+
|
|
98
|
+
workflow = source.fan_out_to([multiply, add_ten], executor="thread").fan_in(aggregate)
|
|
99
|
+
result = workflow(5)
|
|
100
|
+
print(result) # {"total": 25, "results": [10, 15]}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 条件流:分支路由 + 依赖注入
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
from streamlet import BaseFlowContext, node
|
|
107
|
+
from dependency_injector.wiring import Provide
|
|
108
|
+
|
|
109
|
+
container = BaseFlowContext()
|
|
110
|
+
|
|
111
|
+
@node
|
|
112
|
+
def evaluate(data: dict) -> str:
|
|
113
|
+
return "pass" if data["score"] >= 60 else "fail"
|
|
114
|
+
|
|
115
|
+
@node
|
|
116
|
+
def handle_pass(state: dict = Provide[BaseFlowContext.state]) -> dict:
|
|
117
|
+
return {"result": "pass", "score": state["score"]}
|
|
118
|
+
|
|
119
|
+
@node
|
|
120
|
+
def handle_fail(state: dict = Provide[BaseFlowContext.state]) -> dict:
|
|
121
|
+
return {"result": "fail", "score": state["score"]}
|
|
122
|
+
|
|
123
|
+
container.wire(modules=[__name__])
|
|
124
|
+
container.state()["score"] = 75
|
|
125
|
+
|
|
126
|
+
flow = evaluate.branch_on({"pass": handle_pass, "fail": handle_fail})
|
|
127
|
+
print(flow({"score": 75})) # {"result": "pass", "score": 75}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 重试机制
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
from streamlet import node
|
|
134
|
+
|
|
135
|
+
@node(retry_count=3, retry_delay=0.5, backoff_factor=2.0, enable_retry=True)
|
|
136
|
+
def external_call(x: int) -> int:
|
|
137
|
+
# 失败时自动重试,延迟按 0.5s → 1.0s → 2.0s 指数增长
|
|
138
|
+
return call_external_api(x)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## 开发环境
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
git clone https://github.com/12306hujunjie/Streamlet.git
|
|
145
|
+
cd Streamlet
|
|
146
|
+
|
|
147
|
+
pdm install
|
|
148
|
+
|
|
149
|
+
pdm run pytest # 运行测试
|
|
150
|
+
pdm run pytest --cov=src/streamlet # 覆盖率
|
|
151
|
+
pdm run ruff check src/ tests/ # 代码检查
|
|
152
|
+
pdm run mypy src/streamlet/ # 类型检查
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## 技术栈
|
|
156
|
+
|
|
157
|
+
- **Python 3.10+**
|
|
158
|
+
- **dependency-injector** — 依赖注入与线程安全状态管理
|
|
159
|
+
- **pydantic v2** — 类型校验
|
|
160
|
+
|
|
161
|
+
核心模块:`asyncio` | `threading` | `concurrent.futures`
|
|
162
|
+
|
|
163
|
+
## 文档
|
|
164
|
+
|
|
165
|
+
- [API 参考](docs/API参考.md)
|
|
166
|
+
- [CLAUDE.md](CLAUDE.md) — 开发指南
|
|
167
|
+
- `tests/` — 测试用例与使用示例
|
|
168
|
+
|
|
169
|
+
## 许可证
|
|
170
|
+
|
|
171
|
+
MIT — 详见 [LICENSE](LICENSE)
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "streamlet-py"
|
|
3
|
+
version = "0.0.1"
|
|
4
|
+
description = "A powerful Python framework for building declarative, concurrent data processing workflows"
|
|
5
|
+
authors = [
|
|
6
|
+
{ name = "12306hujunjie", email = "545512690@qq.com" },
|
|
7
|
+
]
|
|
8
|
+
dependencies = [
|
|
9
|
+
"dependency-injector>=4.48.1",
|
|
10
|
+
"pydantic>=2.11.7",
|
|
11
|
+
]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
readme = "README.md"
|
|
14
|
+
keywords = [
|
|
15
|
+
"workflow",
|
|
16
|
+
"data-processing",
|
|
17
|
+
"concurrent",
|
|
18
|
+
"declarative",
|
|
19
|
+
"pipeline",
|
|
20
|
+
]
|
|
21
|
+
classifiers = [
|
|
22
|
+
"Development Status :: 3 - Alpha",
|
|
23
|
+
"Intended Audience :: Developers",
|
|
24
|
+
"License :: OSI Approved :: MIT License",
|
|
25
|
+
"Programming Language :: Python :: 3",
|
|
26
|
+
"Programming Language :: Python :: 3.10",
|
|
27
|
+
"Programming Language :: Python :: 3.11",
|
|
28
|
+
"Programming Language :: Python :: 3.12",
|
|
29
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
30
|
+
"Topic :: System :: Distributed Computing",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.license]
|
|
34
|
+
file = "LICENSE"
|
|
35
|
+
|
|
36
|
+
[project.urls]
|
|
37
|
+
Homepage = "https://github.com/12306hujunjie/Streamlet"
|
|
38
|
+
Repository = "https://github.com/12306hujunjie/Streamlet"
|
|
39
|
+
Documentation = "https://github.com/12306hujunjie/Streamlet/blob/main/docs/API参考.md"
|
|
40
|
+
"Bug Tracker" = "https://github.com/12306hujunjie/Streamlet/issues"
|
|
41
|
+
|
|
42
|
+
[build-system]
|
|
43
|
+
requires = [
|
|
44
|
+
"pdm-backend",
|
|
45
|
+
]
|
|
46
|
+
build-backend = "pdm.backend"
|
|
47
|
+
|
|
48
|
+
[dependency-groups]
|
|
49
|
+
dev = [
|
|
50
|
+
"pytest>=8.4.1",
|
|
51
|
+
"pytest-cov>=6.0.0",
|
|
52
|
+
"pytest-html>=4.1.1",
|
|
53
|
+
"flake8>=7.1.1",
|
|
54
|
+
"pre-commit>=4.0.1",
|
|
55
|
+
"ruff>=0.12.9",
|
|
56
|
+
"mypy>=1.13.0",
|
|
57
|
+
"bandit>=1.7.10",
|
|
58
|
+
"pytest-asyncio>=1.1.0",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[tool.ruff]
|
|
62
|
+
line-length = 88
|
|
63
|
+
target-version = "py310"
|
|
64
|
+
|
|
65
|
+
[tool.ruff.lint]
|
|
66
|
+
select = [
|
|
67
|
+
"E",
|
|
68
|
+
"W",
|
|
69
|
+
"F",
|
|
70
|
+
"I",
|
|
71
|
+
"B",
|
|
72
|
+
"C4",
|
|
73
|
+
"UP",
|
|
74
|
+
]
|
|
75
|
+
ignore = [
|
|
76
|
+
"C901",
|
|
77
|
+
"F405",
|
|
78
|
+
"F403",
|
|
79
|
+
"E501",
|
|
80
|
+
"B007",
|
|
81
|
+
"E712",
|
|
82
|
+
"F841",
|
|
83
|
+
"F811",
|
|
84
|
+
"B011",
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
[tool.ruff.format]
|
|
88
|
+
quote-style = "double"
|
|
89
|
+
indent-style = "space"
|
|
90
|
+
line-ending = "auto"
|
|
91
|
+
|
|
92
|
+
[tool.mypy]
|
|
93
|
+
python_version = "3.10"
|
|
94
|
+
warn_return_any = true
|
|
95
|
+
warn_unused_configs = true
|
|
96
|
+
disallow_untyped_defs = true
|
|
97
|
+
disallow_incomplete_defs = true
|
|
98
|
+
check_untyped_defs = true
|
|
99
|
+
disallow_untyped_decorators = true
|
|
100
|
+
no_implicit_optional = true
|
|
101
|
+
warn_redundant_casts = true
|
|
102
|
+
warn_unused_ignores = true
|
|
103
|
+
warn_no_return = true
|
|
104
|
+
warn_unreachable = true
|
|
105
|
+
strict_equality = true
|
|
106
|
+
show_error_codes = true
|
|
107
|
+
|
|
108
|
+
[tool.pytest.ini_options]
|
|
109
|
+
asyncio_mode = "auto"
|
|
110
|
+
testpaths = [
|
|
111
|
+
"tests",
|
|
112
|
+
]
|
|
113
|
+
python_files = [
|
|
114
|
+
"test_*.py",
|
|
115
|
+
]
|
|
116
|
+
python_classes = [
|
|
117
|
+
"Test*",
|
|
118
|
+
]
|
|
119
|
+
python_functions = [
|
|
120
|
+
"test_*",
|
|
121
|
+
]
|
|
122
|
+
addopts = "-v --tb=short"
|
|
123
|
+
filterwarnings = [
|
|
124
|
+
"ignore::DeprecationWarning",
|
|
125
|
+
"ignore::PendingDeprecationWarning",
|
|
126
|
+
]
|
|
127
|
+
|
|
128
|
+
[tool.bandit]
|
|
129
|
+
skips = [
|
|
130
|
+
"B101",
|
|
131
|
+
]
|
|
132
|
+
exclude_dirs = [
|
|
133
|
+
"tests",
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
[tool.pdm]
|
|
137
|
+
distribution = true
|