-
Notifications
You must be signed in to change notification settings - Fork 139
Expand file tree
/
Copy pathpyproject.toml
More file actions
172 lines (151 loc) · 5.3 KB
/
pyproject.toml
File metadata and controls
172 lines (151 loc) · 5.3 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
[project]
name = "lifetrace"
version = "0.1.2"
description = "LifeTrace - A cross-platform screen recording and activity tracking application"
readme = "README.md"
requires-python = ">=3.12,<3.13"
dependencies = [
# Core dependencies
"fastapi>=0.100.0",
"uvicorn[standard]>=0.20.0",
"pydantic>=2.0.0",
"sqlalchemy>=2.0.0",
"sqlmodel>=0.0.22",
"alembic>=1.14.0",
"python-multipart>=0.0.6", # 文件上传支持(Form data)
"icalendar>=6.0.0", # iCalendar (ICS) 导入/导出
# Screenshot and image processing
"mss>=9.0.0",
"Pillow>=10.0.0",
"imagehash>=4.3.0",
"opencv-python>=4.8.0", # For proactive OCR image processing
# OCR processing (rapidocr requires numpy)
"rapidocr-onnxruntime",
"numpy>=2.4.2",
# Audio processing (for ASR WebSocket stream)
"websockets>=16.0", # WebSocket 客户端(用于连接 WhisperLiveKit 服务器)
"python-socks>=2.0.0", # SOCKS 代理支持(websockets 库的可选依赖)
# FunASR 语音识别(可选,需要 Visual C++ 构建工具)
# 如果安装失败,系统音频实时识别功能将不可用
# 安装方法:
# 1. 安装 Visual C++ 构建工具:https://visualstudio.microsoft.com/visual-cpp-build-tools/
# 2. 运行:pip install funasr
# "funasr>=1.0.0", # 注释掉,作为可选依赖
# Data processing
"pyyaml>=6.0",
"sentence-transformers>=2.2.0", # 文本嵌入模型
"chromadb>=1.4.1", # 向量数据库
"scipy>=1.9.0", # 科学计算(用于余弦距离)
"hdbscan>=0.8.0", # 文本聚类算法
# Scheduler
"apscheduler>=3.10.0",
# Utils
"psutil>=7.2.0",
# OpenAI API
"openai>=2.16.0",
# DashScope API (阿里云百炼)
"dashscope>=1.25.0",
# Agno Agent Framework
"agno>=2.4.8",
# DuckDuckGo search for Agno Agent
"ddgs>=9.10.0",
# Tavily API for web search
"tavily-python>=0.7.0",
# Configuration management with hot reload support (includes yaml support)
"dynaconf[yaml]>=3.2.0",
# Logging
"loguru>=0.7.3",
# Observability (Phoenix + OpenInference)
"arize-phoenix>=12.33.0", # Phoenix 服务器和 UI(包含 phoenix serve 命令)
"arize-phoenix-otel>=0.14.0", # Phoenix OTEL 集成
"openinference-instrumentation>=0.1.0", # OpenInference 基础工具(using_session 等)
"openinference-instrumentation-agno>=0.1.0", # Agno 自动 instrument
"opentelemetry-sdk>=1.39.0",
"opentelemetry-exporter-otlp-proto-http>=1.39.0",
# macOS specific dependencies (only install on macOS)
"pyobjc-framework-Cocoa>=12.1; sys_platform == 'darwin'",
"pyobjc-framework-Quartz>=12.1; sys_platform == 'darwin'",
# Windows specific dependencies (only install on Windows)
"pywin32>=306; sys_platform == 'win32'",
"openinference-instrumentation-openai>=0.1.41",
"agno-infra>=1.0.7",
]
[dependency-groups]
# 开发工具
dev = [
"bandit>=1.9.3",
"pre-commit>=4.5.1",
"pytest>=9.0.2",
"pyright>=1.1.408",
"pyinstaller>=6.18.0",
"ruff>=0.14.14",
]
[tool.pytest]
testpaths = ["tests"]
norecursedirs = [".venv", "build", "dist"]
# Ruff 配置 - Python linter 和 formatter
[tool.ruff]
# 每行最大字符数(默认 88,可以根据需要调整)
line-length = 100
# 目标 Python 版本
target-version = "py312"
# 排除的目录
exclude = [".git", ".venv", "__pycache__", "build", "dist", "*.egg-info"]
[tool.ruff.format]
# 使用双引号
quote-style = "double"
# 缩进使用 4 个空格
indent-style = "space"
[tool.ruff.lint]
# 启用的规则集
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear(高价值的潜在 bug 检查)
"C4", # flake8-comprehensions(更合理的推导式)
"SIM", # flake8-simplify(简化 if / boolean / loop)
"UP", # pyupgrade(现代 Python 写法)
"PL", # Pylint(逻辑 / 可维护性)
"C90", # mccabe(复杂度)
"A", # flake8-builtins(避免覆盖内建名)
"ARG", # flake8-unused-arguments
"N", # pep8-naming(命名规范)
"TC", # flake8-type-checking
"FA", # future annotations
"ISC", # implicit string concatenation
"FLY", # flynt(f-string 转换)
"DTZ", # flake8-datetimez(时区相关)
"RUF", # Ruff 原生经验规则
]
# 忽略的规则
ignore = [
"E501", # 行太长(已经通过 line-length 控制)
"B008", # 允许在函数参数默认值中使用函数调用(FastAPI Depends 模式)
"RUF001", # 中文 / 全角标点
"RUF002",
"RUF003",
]
# McCabe 复杂度配置
[tool.ruff.lint.mccabe]
# 最大圈复杂度(软限制:10,硬限制:15)
max-complexity = 10
[tool.ruff.lint.per-file-ignores]
# 测试文件可以使用 assert
"tests/*.py" = ["S101"]
# Pylint 复杂度配置
[tool.ruff.lint.pylint]
# 函数最大语句数(软限制:50,硬限制:100)
max-statements = 50
# 函数最大参数数
max-args = 7
# 函数最大返回语句数
max-returns = 6
# 函数最大分支数
max-branches = 12
# 类中最大公共方法数(帮助控制单个文件大小)
max-public-methods = 20
[tool.uv]
index-url = "https://pypi.tuna.tsinghua.edu.cn/simple"
extra-index-url = ["https://pypi.org/simple"]