fix(msteams): remove optional deps from dev extras and gate tests

PyJWT and cryptography are optional msteams deps; they should not be
bundled into the generic dev install.  Tests now skip the entire file
when the deps are missing, following the dingtalk pattern.
This commit is contained in:
chengyongru authored and Xubin Ren committed 2026-04-16 13:22:07 +08:00
1 parent 4d795f74d5
commit 63753dbfea
2 files changed
+12 -2

No files matched your search

+12 -1
View File
@@ -1,7 +1,18 @@
import json
import jwt
import pytest
# Check optional msteams dependencies before running tests
try:
from nanobot.channels import msteams
MSTEAMS_AVAILABLE = getattr(msteams, "MSTEAMS_AVAILABLE", False)
except ImportError:
MSTEAMS_AVAILABLE = False
if not MSTEAMS_AVAILABLE:
pytest.skip("MSTeams dependencies not installed (PyJWT, cryptography). Run: pip install nanobot-ai[msteams]", allow_module_level=True)
import jwt
from cryptography.hazmat.primitives.asymmetric import rsa
import nanobot.channels.msteams as msteams_module