添加uv支持 (#2119)

* bugfix:修复内存泄露和信号量饥饿问题

* 修复图片渲染按高度截断问题

* 优化图片渲染速度

* 权限检查去掉无效引用代码

* 添加uv支持

* 🚨 auto fix by pre-commit hooks

* bugfix:修改gitignore换行

* bugfix:修复测试没有新生成uv.lock

* 修复导入错误

* bugfix:移除重复调用

* 🚨 auto fix by pre-commit hooks

* 清理残余poetry引用

* 更新uv安装方式

* 修复阿里云获取问题

* 增加资源下载提示

* 🚨 auto fix by pre-commit hooks

* 修改资源下载为流式

* 🚨 auto fix by pre-commit hooks

* 提高启动速度

* 移除bot.py支持

* 🚨 auto fix by pre-commit hooks

* 优化win脚本逻辑

* 🚨 auto fix by pre-commit hooks

* 清理残余无效逻辑

* 代码改进

* 🚨 auto fix by pre-commit hooks

* 增加数据库迁移存在性检查

* 🚨 auto fix by pre-commit hooks

* chore(test): 添加pytest超时控制和优雅关闭机制

- 在GitHub Actions工作流中添加作业级和步骤级超时限制,防止测试无限期挂起
- 添加pytest-timeout依赖并配置全局超时为120秒
- 在send_queue服务添加关闭钩子,确保worker任务正确取消
- 在priority_manager添加on_shutdown钩子,支持优先级生命周期的关闭阶段

* chore(lint): 禁用超长行的lint警告

* Modify restart logic for Windows platform

* 🚨 auto fix by pre-commit hooks

* bugfix:修复sys导入问题

* 清理无效结构

* bugfix:修复路径问题

* bugfix:修复shell语法传递给git导致资源获取失败问题

* 优化关闭显示

* bugfix:修复路径问题

* bugfix:增加路径安全

* bugfix:修复orm绕过问题

* 放宽numpy版本限制

* 修改重启方案

* bugfix:修复循环导入

* 优化逻辑

* Enhance disconnect function with error handling

Added error handling for disconnect function and imported ConfigurationError.

* Implement emergency restart mechanism

Added emergency restart mechanism using atexit to ensure process restart even on severe exceptions during shutdown.

* 🚨 auto fix by pre-commit hooks

* 重启行为归一化

* 修复测试检测问题

* bugfix:修复测试侧类型报错问题

* 引入launcher机制

* 移除重启测试

* 收紧缓存调用路径

* 类型注解收敛

* 优化浏览器回收行为

* 优化浏览器渲染

* bugfix:解决重复关闭浏览器问题

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: ManyManyTomato <93612024+ATTomatoo@users.noreply.github.com>
Co-authored-by: AkashiCoin <l1040186796@gmail.com>
This commit is contained in:
Copaan
2026-04-18 23:42:10 +08:00
committed by GitHub
co-authored by pre-commit-ci[bot] ManyManyTomato AkashiCoin
parent 74bf912d04
commit 8b16126e40
83 changed files with 15394 additions and 7062 deletions
+64 -59
View File
@@ -1,65 +1,70 @@
[tool.poetry]
name = "zhenxun_bot"
[project]
name = "zhenxun-bot-env-pydantic-v1"
version = "0.2.4"
description = "基于 Nonebot2 和 go-cqhttp 开发,以 postgresql 作为数据库,非常可爱的绪山真寻bot"
authors = ["HibiKier <775757368@qq.com>"]
license = "AGPL"
package-mode = false
authors = [{ name = "HibiKier", email = "775757368@qq.com" }]
license = { text = "AGPL-3.0" }
requires-python = ">=3.10"
dependencies = [
"playwright>=1.41.1,<2.0.0",
"nonebot-adapter-onebot>=2.3.1",
"nonebot-plugin-apscheduler>=0.5,<0.6",
"tortoise-orm>=0.20.0,<0.21.0",
"cattrs>=23.2.3,<24.0.0",
"ruamel-yaml>=0.18.5,<0.19.0",
"strenum>=0.4.15,<0.5.0",
"nonebot-plugin-session>=0.3.2,<0.4.0",
"ujson>=5.9.0",
"nb-cli>=1.3.0",
"nonebot2[fastapi]>=2.3.3",
"pillow>=10.0.0,<11.0.0",
"retrying>=1.3.4,<2.0.0",
"aiofiles>=23.2.1,<24.0.0",
"nonebot-plugin-htmlrender>=0.6.0,<1.0.0",
"pypinyin>=0.51.0",
"beautifulsoup4>=4.12.3,<5.0.0",
"lxml>=5.1.0,<6.0.0",
"psutil>=5.9.8,<6.0.0",
"feedparser>=6.0.11,<7.0.0",
"imagehash>=4.3.1,<5.0.0",
"cn2an>=0.5.22,<0.6.0",
"dateparser>=1.2.0,<2.0.0",
"python-jose[cryptography]>=3.3.0,<4.0.0",
"python-multipart>=0.0.9,<0.1.0",
"aiocache[redis]>=0.12.3,<0.13.0",
"py-cpuinfo>=9.0.0,<10.0.0",
"nonebot-plugin-alconna>=0.56.0",
"tenacity>=9.0.0,<10.0.0",
"nonebot-plugin-uninfo>=0.7.3",
"nonebot-plugin-waiter>=0.8.1,<0.9.0",
"multidict>=6.0.0,!=6.3.2",
"pydantic>=1.0.0,<2.0.0",
"json-repair>=0.54.0,<0.55.0",
"alibabacloud-devops20210625>=5.0.2,<6.0.0",
]
[[tool.poetry.source]]
[project.optional-dependencies]
redis = ["redis>=5"]
postgresql = ["asyncpg>=0.20.0"]
[dependency-groups]
dev = [
"nonebug>=0.4,<0.5",
"pytest-cov>=5.0.0,<6.0.0",
"pytest-mock>=3.6.1,<4.0.0",
"pytest-asyncio>=0.25,<0.26",
"pytest-xdist>=3.3.1,<4.0.0",
"respx>=0.21.1,<0.22.0",
"ruff>=0.8.0,<0.9.0",
"pre-commit>=4.0.0,<5.0.0",
]
[tool.uv]
package = false
[[tool.uv.index]]
name = "aliyun"
url = "https://mirrors.aliyun.com/pypi/simple/"
priority = "primary"
[tool.poetry.dependencies]
python = "^3.10"
playwright = "^1.41.1"
nonebot-adapter-onebot = ">=2.3.1"
nonebot-plugin-apscheduler = "^0.5"
tortoise-orm = "^0.20.0"
cattrs = "^23.2.3"
ruamel-yaml = "^0.18.5"
strenum = "^0.4.15"
nonebot-plugin-session = "^0.3.2"
ujson = ">=5.9.0"
nb-cli = ">=1.3.0"
nonebot2 = { extras = ["fastapi"], version = ">=2.3.3" }
pillow = "^10.0.0"
retrying = "^1.3.4"
aiofiles = "^23.2.1"
nonebot-plugin-htmlrender = ">=0.6.0,<1.0.0"
pypinyin = ">=0.51.0"
beautifulsoup4 = "^4.12.3"
lxml = "^5.1.0"
psutil = "^5.9.8"
feedparser = "^6.0.11"
imagehash = "^4.3.1"
cn2an = "^0.5.22"
dateparser = "^1.2.0"
python-jose = { extras = ["cryptography"], version = "^3.3.0" }
python-multipart = "^0.0.9"
aiocache = {extras = ["redis"], version = "^0.12.3"}
py-cpuinfo = "^9.0.0"
nonebot-plugin-alconna = ">=0.56.0"
tenacity = "^9.0.0"
nonebot-plugin-uninfo = ">=0.7.3"
nonebot-plugin-waiter = "^0.8.1"
multidict = ">=6.0.0,!=6.3.2"
pydantic = ">=1.0.0, <2.0.0"
redis = { version = ">=5", optional = true }
asyncpg = { version = ">=0.20.0", optional = true }
alibabacloud-devops20210625 = "^5.0.2"
json_repair = "^0.54.0"
[tool.poetry.group.dev.dependencies]
nonebug = "^0.4"
pytest-cov = "^5.0.0"
pytest-mock = "^3.6.1"
pytest-asyncio = "^0.25"
pytest-xdist = "^3.3.1"
respx = "^0.21.1"
ruff = "^0.8.0"
pre-commit = "^4.0.0"
[tool.nonebot]
plugins = [
@@ -140,5 +145,5 @@ asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"
+4301
View File
File diff suppressed because it is too large Load Diff
+64 -60
View File
@@ -1,66 +1,70 @@
[tool.poetry]
name = "zhenxun_bot"
[project]
name = "zhenxun-bot-env-pydantic-v2"
version = "0.2.4"
description = "基于 Nonebot2 和 go-cqhttp 开发,以 postgresql 作为数据库,非常可爱的绪山真寻bot"
authors = ["HibiKier <775757368@qq.com>"]
license = "AGPL"
package-mode = false
authors = [{ name = "HibiKier", email = "775757368@qq.com" }]
license = { text = "AGPL-3.0" }
requires-python = ">=3.10"
dependencies = [
"playwright>=1.41.1,<2.0.0",
"nonebot-adapter-onebot>=2.3.1",
"nonebot-plugin-apscheduler>=0.5,<0.6",
"tortoise-orm>=0.20.0,<0.21.0",
"cattrs>=23.2.3,<24.0.0",
"ruamel-yaml>=0.18.5,<0.19.0",
"strenum>=0.4.15,<0.5.0",
"nonebot-plugin-session>=0.3.2,<0.4.0",
"ujson>=5.9.0",
"nb-cli>=1.3.0",
"nonebot2[fastapi]>=2.3.3",
"pillow>=10.0.0,<11.0.0",
"retrying>=1.3.4,<2.0.0",
"aiofiles>=23.2.1,<24.0.0",
"nonebot-plugin-htmlrender>=0.6.0,<1.0.0",
"pypinyin>=0.51.0",
"beautifulsoup4>=4.12.3,<5.0.0",
"lxml>=5.1.0,<6.0.0",
"psutil>=5.9.8,<6.0.0",
"feedparser>=6.0.11,<7.0.0",
"imagehash>=4.3.1,<5.0.0",
"cn2an>=0.5.22,<0.6.0",
"dateparser>=1.2.0,<2.0.0",
"python-jose[cryptography]>=3.3.0,<4.0.0",
"python-multipart>=0.0.9,<0.1.0",
"aiocache[redis]>=0.12.3,<0.13.0",
"py-cpuinfo>=9.0.0,<10.0.0",
"nonebot-plugin-alconna>=0.56.0",
"tenacity>=9.0.0,<10.0.0",
"nonebot-plugin-uninfo>=0.7.3",
"nonebot-plugin-waiter>=0.8.1,<0.9.0",
"multidict>=6.0.0,!=6.3.2",
"pydantic>=2.0.0,<3.0.0",
"json-repair>=0.54.0,<0.55.0",
"alibabacloud-devops20210625>=5.0.2,<6.0.0",
]
[[tool.poetry.source]]
[project.optional-dependencies]
redis = ["redis>=5"]
postgresql = ["asyncpg>=0.20.0"]
[dependency-groups]
dev = [
"nonebug>=0.4,<0.5",
"pytest-cov>=5.0.0,<6.0.0",
"pytest-mock>=3.6.1,<4.0.0",
"pytest-asyncio>=0.25,<0.26",
"pytest-xdist>=3.3.1,<4.0.0",
"respx>=0.21.1,<0.22.0",
"ruff>=0.8.0,<0.9.0",
"pre-commit>=4.0.0,<5.0.0",
]
[tool.uv]
package = false
[[tool.uv.index]]
name = "aliyun"
url = "https://mirrors.aliyun.com/pypi/simple/"
priority = "primary"
[tool.poetry.dependencies]
python = "^3.10"
playwright = "^1.41.1"
nonebot-adapter-onebot = ">=2.3.1"
nonebot-plugin-apscheduler = "^0.5"
tortoise-orm = "^0.20.0"
cattrs = "^23.2.3"
ruamel-yaml = "^0.18.5"
strenum = "^0.4.15"
nonebot-plugin-session = "^0.3.2"
ujson = ">=5.9.0"
nb-cli = ">=1.3.0"
nonebot2 = { extras = ["fastapi"], version = ">=2.3.3" }
pillow = "^10.0.0"
retrying = "^1.3.4"
aiofiles = "^23.2.1"
nonebot-plugin-htmlrender = ">=0.6.0,<1.0.0"
pypinyin = ">=0.51.0"
beautifulsoup4 = "^4.12.3"
lxml = "^5.1.0"
psutil = "^5.9.8"
feedparser = "^6.0.11"
imagehash = "^4.3.1"
cn2an = "^0.5.22"
dateparser = "^1.2.0"
python-jose = { extras = ["cryptography"], version = "^3.3.0" }
python-multipart = "^0.0.9"
aiocache = {extras = ["redis"], version = "^0.12.3"}
py-cpuinfo = "^9.0.0"
nonebot-plugin-alconna = ">=0.56.0"
tenacity = "^9.0.0"
nonebot-plugin-uninfo = ">=0.7.3"
nonebot-plugin-waiter = "^0.8.1"
multidict = ">=6.0.0,!=6.3.2"
pydantic = ">=2.0.0, <3.0.0"
redis = { version = ">=5", optional = true }
asyncpg = { version = ">=0.20.0", optional = true }
alibabacloud-devops20210625 = "^5.0.2"
json_repair = "^0.54.0"
[tool.poetry.group.dev.dependencies]
nonebug = "^0.4"
pytest-cov = "^5.0.0"
pytest-mock = "^3.6.1"
pytest-asyncio = "^0.25"
pytest-xdist = "^3.3.1"
respx = "^0.21.1"
ruff = "^0.8.0"
pre-commit = "^4.0.0"
[tool.nonebot]
plugins = [
@@ -141,5 +145,5 @@ asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"
+4418
View File
File diff suppressed because it is too large Load Diff