mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: guard all atroposlib imports for CI without atropos installed
- environments/__init__.py: try/except on atroposlib imports so submodules like tool_call_parsers remain importable standalone - test_agent_loop.py, test_tool_call_parsers.py, test_managed_server_tool_support.py: skip at module level when atroposlib is missing
This commit is contained in:
parent
0f53275169
commit
d198a647e2
4 changed files with 32 additions and 16 deletions
|
|
@ -18,9 +18,14 @@ Benchmarks (eval-only):
|
||||||
- benchmarks/terminalbench_2/: Terminal-Bench 2.0 evaluation
|
- benchmarks/terminalbench_2/: Terminal-Bench 2.0 evaluation
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from environments.agent_loop import AgentResult, HermesAgentLoop
|
try:
|
||||||
from environments.tool_context import ToolContext
|
from environments.agent_loop import AgentResult, HermesAgentLoop
|
||||||
from environments.hermes_base_env import HermesAgentBaseEnv, HermesAgentEnvConfig
|
from environments.tool_context import ToolContext
|
||||||
|
from environments.hermes_base_env import HermesAgentBaseEnv, HermesAgentEnvConfig
|
||||||
|
except ImportError:
|
||||||
|
# atroposlib not installed — environments are unavailable but
|
||||||
|
# submodules like tool_call_parsers can still be imported directly.
|
||||||
|
pass
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"AgentResult",
|
"AgentResult",
|
||||||
|
|
|
||||||
|
|
@ -18,13 +18,16 @@ import pytest
|
||||||
# Ensure repo root is importable
|
# Ensure repo root is importable
|
||||||
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
||||||
|
|
||||||
from environments.agent_loop import (
|
try:
|
||||||
AgentResult,
|
from environments.agent_loop import (
|
||||||
HermesAgentLoop,
|
AgentResult,
|
||||||
ToolError,
|
HermesAgentLoop,
|
||||||
_extract_reasoning_from_message,
|
ToolError,
|
||||||
resize_tool_pool,
|
_extract_reasoning_from_message,
|
||||||
)
|
resize_tool_pool,
|
||||||
|
)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip("atroposlib not installed", allow_module_level=True)
|
||||||
|
|
||||||
|
|
||||||
# ─── Mock server infrastructure ─────────────────────────────────────────
|
# ─── Mock server infrastructure ─────────────────────────────────────────
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,11 @@ import pytest
|
||||||
|
|
||||||
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
||||||
|
|
||||||
|
try:
|
||||||
|
import atroposlib # noqa: F401
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip("atroposlib not installed", allow_module_level=True)
|
||||||
|
|
||||||
|
|
||||||
class TestManagedServerAPI:
|
class TestManagedServerAPI:
|
||||||
"""Test that ManagedServer's API matches what hermes-agent expects."""
|
"""Test that ManagedServer's API matches what hermes-agent expects."""
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,15 @@ import pytest
|
||||||
# Ensure repo root is importable
|
# Ensure repo root is importable
|
||||||
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
||||||
|
|
||||||
from environments.tool_call_parsers import (
|
try:
|
||||||
ParseResult,
|
from environments.tool_call_parsers import (
|
||||||
ToolCallParser,
|
ParseResult,
|
||||||
get_parser,
|
ToolCallParser,
|
||||||
list_parsers,
|
get_parser,
|
||||||
)
|
list_parsers,
|
||||||
|
)
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip("atroposlib not installed", allow_module_level=True)
|
||||||
|
|
||||||
|
|
||||||
# ─── Registry tests ─────────────────────────────────────────────────────
|
# ─── Registry tests ─────────────────────────────────────────────────────
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue