Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
190 lines (163 loc) · 6.07 KB
/
Copy pathpyproject.toml
File metadata and controls
190 lines (163 loc) · 6.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# ============================================================================
# SAGE Examples Package Configuration
# ============================================================================
# Production application examples for SAGE framework
# ============================================================================
# ----------------------------------------------------------------------------
# 构建系统配置
# ----------------------------------------------------------------------------
[build-system]
requires = [
"setuptools>=65.0", # 现代 setuptools
"wheel", # wheel 构建支持
]
build-backend = "setuptools.build_meta"
# ----------------------------------------------------------------------------
# 项目元数据
# ----------------------------------------------------------------------------
[project]
name = "isage-examples"
version = "0.1.1.20"
description = "SAGE Examples - Production application examples for SAGE framework"
readme = "README.md"
requires-python = ">=3.10"
# 许可证
license = "MIT"
# 项目作者
authors = [{ name = "IntelliStream Team", email = "shuhao_zhang@hust.edu.cn" }]
# PyPI 搜索关键词
keywords = [
"sage",
"examples",
"applications",
"ai",
"llm",
"rag",
"multimodal",
"video-intelligence",
"medical-diagnosis",
"computer-vision",
"intellistream",
]
# PyPI 分类器
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Education",
]
# ----------------------------------------------------------------------------
# 核心依赖 - 运行应用示例所需的依赖(遵循 SAGE 原则:默认安装)
# ----------------------------------------------------------------------------
dependencies = [
# 单一 SAGE 主仓核心包
"isage>=0.3.0",
# 基础工具
"pyyaml>=6.0", # 配置文件解析
"numpy>=1.26.0,<2.3.0", # 数组操作
# 应用示例依赖(所有示例运行所需)
"pillow>=10.0.0", # 图像处理
"opencv-python-headless>=4.5.0", # 视频处理(无GUI依赖)
"torch>=2.7.0,<3.0.0", # PyTorch 深度学习框架
"torchvision>=0.22.0,<1.0.0", # 视觉模型
"transformers>=4.52.0", # CLIP 和 transformers
"scikit-learn>=1.3.0", # 机器学习工具
"beautifulsoup4>=4.9.0", # HTML 解析
"requests>=2.25.0", # HTTP 请求
]
# ----------------------------------------------------------------------------
# 可选依赖组 - 仅开发模式(遵循 SAGE 原则:只有 dev)
# ----------------------------------------------------------------------------
[project.optional-dependencies]
full = []
# 开发和测试依赖
dev = [
"isage-examples[full]",
"pytest>=7.0.0", # 测试框架
"pytest-cov>=4.0.0", # 覆盖率报告
"ruff==0.14.6", # 代码检查和格式化(与 SAGE 主仓库版本一致)
"mypy>=1.0.0", # 静态类型检查
"black>=23.0.0", # 代码格式化
]
# ----------------------------------------------------------------------------
# 项目链接
# ----------------------------------------------------------------------------
[project.urls]
Homepage = "https://github.com/intellistream/SAGE"
Documentation = "https://intellistream.github.io/sage-docs"
Repository = "https://github.com/intellistream/sage-examples"
Issues = "https://github.com/intellistream/SAGE/issues"
# ----------------------------------------------------------------------------
# 包构建配置
# ----------------------------------------------------------------------------
[tool.setuptools.packages.find]
where = ["."] # 源码搜索根目录
include = [
"examples*", # 应用示例
]
exclude = [
"tests*", # 排除测试
"apps*", # apps 独立打包
"*.egg-info*", # 排除构建产物
"__pycache__*", # 排除缓存
]
[tool.setuptools]
zip-safe = false
# 包含数据文件 (简化配置,移除注释避免 bytecode compiler 解析错误)
[tool.setuptools.package-data]
"*" = ["*.yaml", "*.yml", "*.json", "*.txt", "*.md", "data/**/*", "config/**/*"]
# ----------------------------------------------------------------------------
# 开发工具配置
# ----------------------------------------------------------------------------
# 代码格式化 (Black)
[tool.black]
line-length = 100 # 最大行长度
target-version = ['py310', 'py311'] # 目标 Python 版本
# 代码检查和格式化 (Ruff)
[tool.ruff]
line-length = 100
target-version = "py310"
[tool.ruff.lint]
select = ["E", "F", "W", "I"]
ignore = ["E501"] # 行长度由 formatter 处理
[tool.ruff.lint.isort]
known-first-party = ["sage"]
# 静态类型检查 (MyPy)
[tool.mypy]
python_version = "3.10" # Python 版本
warn_return_any = false # 示例代码不强制要求
warn_unused_configs = true # 警告未使用的配置
disallow_untyped_defs = false # 允许无类型定义
ignore_missing_imports = true # 忽略缺失的导入
# ----------------------------------------------------------------------------
# 测试配置 (Pytest)
# ----------------------------------------------------------------------------
[tool.pytest.ini_options]
# 测试文件搜索路径
testpaths = ["examples", "apps/tests"]
pythonpath = ["apps/src"]
# 测试文件匹配模式
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
# 日志配置
log_cli = true
log_cli_level = "INFO"
# 测试运行参数
addopts = [
"-v", # 详细输出
"--tb=short", # 简短回溯
]
# 测试标记定义
markers = [
"examples: Example applications",
"slow: Slow tests (use -m 'not slow' to skip)",
"gpu: Tests requiring GPU",
]