Skip to content

Commit d48a3c2

Browse files
committed
linter
1 parent 921651b commit d48a3c2

10 files changed

Lines changed: 22 additions & 17 deletions

File tree

src/a2a/server/routes/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010

1111
__all__ = [
12-
'create_agent_card_routes',
1312
'CallContextBuilder',
1413
'DefaultCallContextBuilder',
14+
'create_agent_card_routes',
1515
'create_jsonrpc_routes',
1616
]

src/a2a/server/routes/agent_card_routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22

3-
from collections.abc import Awaitable, Callable, Sequence
3+
from collections.abc import Awaitable, Callable
44
from typing import TYPE_CHECKING, Any
55

66

src/a2a/server/routes/jsonrpc_routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22

3-
from collections.abc import Awaitable, Callable, Sequence
3+
from collections.abc import Awaitable, Callable
44
from typing import TYPE_CHECKING, Any
55

66

tests/integration/cross_version/client_server/server_1_0.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import grpc
66

77
from a2a.server.agent_execution import AgentExecutor, RequestContext
8-
from a2a.server.routes import AgentCardRoutes, create_jsonrpc_routes
8+
from a2a.server.routes import create_agent_card_routes, create_jsonrpc_routes
99
from a2a.server.apps import A2ARESTFastAPIApplication
1010
from a2a.server.events import EventQueue
1111
from a2a.server.events.in_memory_queue_manager import InMemoryQueueManager
@@ -167,7 +167,7 @@ async def main_async(http_port: int, grpc_port: int):
167167
app = FastAPI()
168168
app.add_middleware(CustomLoggingMiddleware)
169169

170-
agent_card_routes = AgentCardRoutes(
170+
agent_card_routes = create_agent_card_routes(
171171
agent_card=agent_card, card_url='/.well-known/agent-card.json'
172172
)
173173
jsonrpc_routes = create_jsonrpc_routes(
@@ -179,7 +179,7 @@ async def main_async(http_port: int, grpc_port: int):
179179
)
180180
app.mount(
181181
'/jsonrpc',
182-
FastAPI(routes=jsonrpc_routes + agent_card_routes.routes),
182+
FastAPI(routes=jsonrpc_routes + agent_card_routes),
183183
)
184184

185185
app.mount(

tests/integration/test_client_server_integration.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ def http_base_setup(mock_request_handler: AsyncMock, agent_card: AgentCard):
222222
def jsonrpc_setup(http_base_setup) -> TransportSetup:
223223
"""Sets up the JsonRpcTransport and in-memory server."""
224224
mock_request_handler, agent_card = http_base_setup
225-
agent_card_routes = create_agent_card_routes(agent_card=agent_card, card_url='/')
225+
agent_card_routes = create_agent_card_routes(
226+
agent_card=agent_card, card_url='/'
227+
)
226228
jsonrpc_routes = create_jsonrpc_routes(
227229
agent_card=agent_card,
228230
request_handler=mock_request_handler,
@@ -695,7 +697,9 @@ async def test_client_get_signed_extended_card(
695697
},
696698
)
697699

698-
agent_card_routes = create_agent_card_routes(agent_card=agent_card, card_url='/')
700+
agent_card_routes = create_agent_card_routes(
701+
agent_card=agent_card, card_url='/'
702+
)
699703
jsonrpc_routes = create_jsonrpc_routes(
700704
agent_card=agent_card,
701705
request_handler=mock_request_handler,

tests/integration/test_end_to_end.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ def rest_setup(agent_card, base_e2e_setup) -> ClientSetup:
194194
@pytest.fixture
195195
def jsonrpc_setup(agent_card, base_e2e_setup) -> ClientSetup:
196196
task_store, handler = base_e2e_setup
197-
agent_card_routes = create_agent_card_routes(agent_card=agent_card, card_url='/')
197+
agent_card_routes = create_agent_card_routes(
198+
agent_card=agent_card, card_url='/'
199+
)
198200
jsonrpc_routes = create_jsonrpc_routes(
199201
agent_card=agent_card,
200202
request_handler=handler,

tests/integration/test_tenant.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,7 @@ def server_app(self, jsonrpc_agent_card, mock_handler):
207207
extended_agent_card=jsonrpc_agent_card,
208208
rpc_url='/jsonrpc',
209209
)
210-
app = Starlette(
211-
routes=[*agent_card_routes, *jsonrpc_routes]
212-
)
210+
app = Starlette(routes=[*agent_card_routes, *jsonrpc_routes])
213211
return app
214212

215213
@pytest.mark.asyncio

tests/integration/test_version_header.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ async def mock_on_message_send_stream(*args, **kwargs):
5757
handler.on_message_send_stream = mock_on_message_send_stream
5858

5959
app = FastAPI()
60-
agent_card_routes = create_agent_card_routes(agent_card=agent_card, card_url='/')
60+
agent_card_routes = create_agent_card_routes(
61+
agent_card=agent_card, card_url='/'
62+
)
6163
jsonrpc_routes = create_jsonrpc_routes(
6264
agent_card=agent_card,
6365
request_handler=handler,

tests/server/routes/test_agent_card_routes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ async def modifier(card: AgentCard) -> AgentCard:
6262
def test_agent_card_custom_url(agent_card):
6363
"""Tests that custom card_url is respected."""
6464
custom_url = '/custom/path/agent.json'
65-
routes = create_agent_card_routes(agent_card=agent_card, card_url=custom_url)
65+
routes = create_agent_card_routes(
66+
agent_card=agent_card, card_url=custom_url
67+
)
6668

6769
app = Starlette(routes=routes)
6870
client = TestClient(app)
@@ -71,5 +73,3 @@ def test_agent_card_custom_url(agent_card):
7173
assert client.get('/.well-known/agent-card.json').status_code == 404
7274
# Check that custom returns 200
7375
assert client.get(custom_url).status_code == 200
74-
75-

tests/server/routes/test_jsonrpc_routes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,3 @@ def test_jsonrpc_custom_url(agent_card, mock_handler):
5959
assert 'error' in resp_json
6060
# Method not found error from dispatcher
6161
assert resp_json['error']['code'] == -32601
62-

0 commit comments

Comments
 (0)