mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-01 07:15:52 +00:00
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:
parent
8f0b653a4c
commit
3723cd726e
@ -85,8 +85,6 @@ dev = [
|
|||||||
"aiohttp>=3.9.0,<4.0.0",
|
"aiohttp>=3.9.0,<4.0.0",
|
||||||
"pytest-cov>=6.0.0,<7.0.0",
|
"pytest-cov>=6.0.0,<7.0.0",
|
||||||
"ruff>=0.1.0",
|
"ruff>=0.1.0",
|
||||||
"PyJWT>=2.0,<3.0",
|
|
||||||
"cryptography>=41.0",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
|
|||||||
@ -1,7 +1,18 @@
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
import jwt
|
|
||||||
import pytest
|
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
|
from cryptography.hazmat.primitives.asymmetric import rsa
|
||||||
|
|
||||||
import nanobot.channels.msteams as msteams_module
|
import nanobot.channels.msteams as msteams_module
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user