Skip to content

Commit 698f367

Browse files
committed
Fix lint errors
1 parent 5fd795e commit 698f367

24 files changed

+85
-73
lines changed

src/a2a/auth/user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class UnauthenticatedUser(User):
2121
"""A representation that no user has been authenticated in the request."""
2222

2323
@property
24-
def is_authenticated(self):
24+
def is_authenticated(self) -> bool:
2525
return False
2626

2727
@property

src/a2a/server/agent_execution/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def get_user_input(self, delimiter='\n') -> str:
8080

8181
return get_message_text(self._params.message, delimiter)
8282

83-
def attach_related_task(self, task: Task):
83+
def attach_related_task(self, task: Task) -> None:
8484
"""Attaches a related task to the context.
8585
8686
This is useful for scenarios like tool execution where a new task

src/a2a/server/agent_execution/request_context_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
class RequestContextBuilder(ABC):
9-
"""Builds request context to be supplied to agent executor"""
9+
"""Builds request context to be supplied to agent executor."""
1010

1111
@abstractmethod
1212
async def build(

src/a2a/server/agent_execution/simple_request_context_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class SimpleRequestContextBuilder(RequestContextBuilder):
10-
"""Builds request context and populates referred tasks"""
10+
"""Builds request context and populates referred tasks."""
1111

1212
def __init__(
1313
self,

src/a2a/server/apps/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""HTTP application components for the A2A server."""
22

3-
from .jsonrpc import (
3+
from a2a.server.apps.jsonrpc import (
44
A2AFastAPIApplication,
55
A2AStarletteApplication,
66
CallContextBuilder,

src/a2a/server/apps/jsonrpc/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
"""A2A JSON-RPC Applications."""
22

3-
from .fastapi_app import A2AFastAPIApplication
4-
from .jsonrpc_app import CallContextBuilder, JSONRPCApplication
5-
from .starlette_app import A2AStarletteApplication
3+
from a2a.server.apps.jsonrpc.fastapi_app import A2AFastAPIApplication
4+
from a2a.server.apps.jsonrpc.jsonrpc_app import (
5+
CallContextBuilder,
6+
JSONRPCApplication,
7+
)
8+
from a2a.server.apps.jsonrpc.starlette_app import A2AStarletteApplication
69

710

811
__all__ = [

src/a2a/server/apps/jsonrpc/fastapi_app.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
from fastapi import FastAPI, Request
66

7+
from a2a.server.apps.jsonrpc.jsonrpc_app import (
8+
CallContextBuilder,
9+
JSONRPCApplication,
10+
)
711
from a2a.server.request_handlers.jsonrpc_handler import RequestHandler
812
from a2a.types import AgentCard
913

10-
from .jsonrpc_app import CallContextBuilder, JSONRPCApplication
11-
1214

1315
logger = logging.getLogger(__name__)
1416

@@ -50,8 +52,8 @@ def __init__(
5052
def build(
5153
self,
5254
agent_card_url: str = '/.well-known/agent.json',
53-
extended_agent_card_url: str = '/agent/authenticatedExtendedCard',
5455
rpc_url: str = '/',
56+
extended_agent_card_url: str = '/agent/authenticatedExtendedCard',
5557
**kwargs: Any,
5658
) -> FastAPI:
5759
"""Builds and returns the FastAPI application instance.

src/a2a/server/apps/jsonrpc/starlette_app.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
from starlette.applications import Starlette
66
from starlette.routing import Route
77

8+
from a2a.server.apps.jsonrpc.jsonrpc_app import (
9+
CallContextBuilder,
10+
JSONRPCApplication,
11+
)
812
from a2a.server.request_handlers.jsonrpc_handler import RequestHandler
913
from a2a.types import AgentCard
1014

11-
from .jsonrpc_app import CallContextBuilder, JSONRPCApplication
12-
1315

1416
logger = logging.getLogger(__name__)
1517

@@ -93,8 +95,8 @@ def routes(
9395
def build(
9496
self,
9597
agent_card_url: str = '/.well-known/agent.json',
96-
extended_agent_card_url: str = '/agent/authenticatedExtendedCard',
9798
rpc_url: str = '/',
99+
extended_agent_card_url: str = '/agent/authenticatedExtendedCard',
98100
**kwargs: Any,
99101
) -> Starlette:
100102
"""Builds and returns the Starlette application instance.
@@ -103,8 +105,7 @@ def build(
103105
agent_card_url: The URL path for the agent card endpoint.
104106
rpc_url: The URL path for the A2A JSON-RPC endpoint (POST requests).
105107
extended_agent_card_url: The URL for the authenticated extended agent card endpoint.
106-
**kwargs: Additional keyword arguments to pass to the Starlette
107-
constructor.
108+
**kwargs: Additional keyword arguments to pass to the Starlette constructor.
108109
109110
Returns:
110111
A configured Starlette application instance.

src/a2a/server/events/event_consumer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ async def consume_all(self) -> AsyncGenerator[Event]:
135135
if self.queue.is_closed():
136136
break
137137

138-
def agent_task_callback(self, agent_task: asyncio.Task[None]):
138+
def agent_task_callback(self, agent_task: asyncio.Task[None]) -> None:
139139
"""Callback to handle exceptions from the agent's execution task.
140140
141141
If the agent's asyncio task raises an exception, this callback is

src/a2a/server/events/event_queue.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self, max_queue_size: int = DEFAULT_MAX_QUEUE_SIZE) -> None:
4343
self._lock = asyncio.Lock()
4444
logger.debug('EventQueue initialized.')
4545

46-
async def enqueue_event(self, event: Event):
46+
async def enqueue_event(self, event: Event) -> None:
4747
"""Enqueues an event to this queue and all its children.
4848
4949
Args:
@@ -127,7 +127,7 @@ def tap(self) -> 'EventQueue':
127127
self._children.append(queue)
128128
return queue
129129

130-
async def close(self):
130+
async def close(self) -> None:
131131
"""Closes the queue for future push events.
132132
133133
Once closed, `dequeue_event` will eventually raise `asyncio.QueueShutDown`

0 commit comments

Comments
 (0)