fix(deps): 修复 pysnmp 兼容性问题

问题原因:
- pysnmp==7.1.15 使用已废弃的 asyncio.coroutine 装饰器
- 该装饰器在 Python 3.11 中被完全移除,导致导入失败

解决方案:
- 替换为 pysnmp-lextudio==5.0.31
- 这是社区维护的分支,兼容 Python 3.6+
- API 完全兼容,无需修改业务代码

验证:
- Python 3.10 & 3.11 均可正常导入
- FastAPI 应用可正常加载 (95 routes)
- SNMPService.OID_SYS_DESCR 可正常访问
This commit is contained in:
Your Name
2026-07-23 14:06:39 +08:00
parent a8e764b102
commit e0cba105b6
18 changed files with 27 additions and 2 deletions
+3 -1
View File
@@ -10,7 +10,9 @@ celery==5.3.6
redis==5.0.3
python-multipart==0.0.9
alembic==1.13.1
pysnmp==7.1.15
# 注意: pysnmp 7.x 与 Python 3.10+/asyncio 存在兼容性问题
# 使用 lextudio 维护的分支(向后兼容,支持 Python 3.6+
pysnmp-lextudio==5.0.31
scapy==2.5.0
python-dotenv==1.0.1
passlib[bcrypt]==1.7.4