Skip to content

Commit 5f8fa22

Browse files
ci: move test Ruff config into tests
1 parent a1e01eb commit 5f8fa22

45 files changed

Lines changed: 102 additions & 188 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/linter.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- '**.py'
88
- '**.pyi'
99
- pyproject.toml
10+
- tests/pyproject.toml
1011
- uv.lock
1112
- .jscpd.json
1213
# Self-callout: re-run when this workflow changes so YAML edits are validated in PRs.
@@ -36,10 +37,6 @@ jobs:
3637
id: ruff-lint
3738
run: uv run ruff check --output-format=github
3839
continue-on-error: true
39-
- name: Run Ruff Test Hygiene
40-
id: ruff-tests
41-
run: uv run ruff check tests --config ruff-tests.toml --output-format=github
42-
continue-on-error: true
4340
- name: Run Ruff Formatter
4441
id: ruff-format
4542
run: uv run ruff format --check
@@ -62,15 +59,13 @@ jobs:
6259
if: always() # This ensures the step runs even if previous steps failed
6360
env:
6461
RUFF_LINT: ${{ steps.ruff-lint.outcome }}
65-
RUFF_TESTS: ${{ steps.ruff-tests.outcome }}
6662
RUFF_FORMAT: ${{ steps.ruff-format.outcome }}
6763
MYPY: ${{ steps.mypy.outcome }}
6864
PYRIGHT: ${{ steps.pyright.outcome }}
6965
JSCPD: ${{ steps.jscpd.outcome }}
7066
run: |-
7167
failed=()
7268
[[ "$RUFF_LINT" == "failure" ]] && failed+=("Ruff Linter")
73-
[[ "$RUFF_TESTS" == "failure" ]] && failed+=("Ruff Test Hygiene")
7469
[[ "$RUFF_FORMAT" == "failure" ]] && failed+=("Ruff Formatter")
7570
[[ "$MYPY" == "failure" ]] && failed+=("MyPy")
7671
[[ "$PYRIGHT" == "failure" ]] && failed+=("Pyright")

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ exclude = [
292292
"src/a2a/compat/v0_3/*_pb2.py",
293293
"src/a2a/compat/v0_3/*_pb2.pyi",
294294
"src/a2a/compat/v0_3/*_pb2_grpc.py",
295-
"tests/**",
296295
]
297296

298297
[tool.ruff.lint.isort]

tests/client/test_auth_interceptor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import pytest
1010
import respx
1111

12-
from google.protobuf import json_format
13-
1412
from a2a.client import (
1513
AuthInterceptor,
1614
Client,
@@ -39,6 +37,7 @@
3937
StringList,
4038
)
4139
from a2a.utils.constants import TransportProtocol
40+
from google.protobuf import json_format
4241

4342

4443
def build_success_response(request: httpx.Request) -> httpx.Response:

tests/client/transports/test_grpc_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import grpc
44
import pytest
55

6-
from google.protobuf import any_pb2
7-
from google.rpc import error_details_pb2, status_pb2
8-
96
from a2a.client.client import ClientCallContext
107
from a2a.client.transports.grpc import GrpcTransport
118
from a2a.extensions.common import HTTP_EXTENSION_HEADER
@@ -34,6 +31,8 @@
3431
)
3532
from a2a.utils.constants import PROTOCOL_VERSION_CURRENT, VERSION_HEADER
3633
from a2a.utils.errors import A2A_ERROR_REASONS
34+
from google.protobuf import any_pb2
35+
from google.rpc import error_details_pb2, status_pb2
3736

3837

3938
@pytest.fixture

tests/client/transports/test_jsonrpc_client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
import httpx
99
import pytest
1010

11-
from google.protobuf import json_format
12-
from httpx_sse import EventSource, SSEError
13-
1411
from a2a.client.errors import A2AClientError
1512
from a2a.client.transports.jsonrpc import JsonRpcTransport
1613
from a2a.types.a2a_pb2 import (
@@ -33,6 +30,8 @@
3330
TaskState,
3431
)
3532
from a2a.utils.errors import JSON_RPC_ERROR_CODE_MAP
33+
from google.protobuf import json_format
34+
from httpx_sse import EventSource, SSEError
3635

3736

3837
@pytest.fixture

tests/client/transports/test_rest_client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
import httpx
55
import pytest
66

7-
from google.protobuf import json_format
8-
from google.protobuf.timestamp_pb2 import Timestamp
9-
from httpx_sse import EventSource, ServerSentEvent
10-
117
from a2a.client.client import ClientCallContext
128
from a2a.client.errors import A2AClientError
139
from a2a.client.transports.rest import RestTransport
@@ -31,6 +27,9 @@
3127
)
3228
from a2a.utils.constants import TransportProtocol
3329
from a2a.utils.errors import A2A_REST_ERROR_MAPPING
30+
from google.protobuf import json_format
31+
from google.protobuf.timestamp_pb2 import Timestamp
32+
from httpx_sse import EventSource, ServerSentEvent
3433

3534

3635
@pytest.fixture

tests/compat/v0_3/test_context_builders.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import grpc
44

5-
from starlette.datastructures import Headers
6-
75
from a2a.compat.v0_3.context_builders import (
86
V03GrpcServerCallContextBuilder,
97
V03ServerCallContextBuilder,
@@ -15,6 +13,7 @@
1513
DefaultGrpcServerCallContextBuilder,
1614
)
1715
from a2a.server.routes.common import DefaultServerCallContextBuilder
16+
from starlette.datastructures import Headers
1817

1918

2019
def _make_mock_request(headers=None):

tests/compat/v0_3/test_conversions.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
import pytest
55

6-
from cryptography.fernet import Fernet
7-
from google.protobuf.json_format import ParseDict
8-
96
from a2a.compat.v0_3 import types as types_v03
107
from a2a.compat.v0_3.conversions import (
118
to_compat_agent_capabilities,
@@ -83,6 +80,8 @@
8380
)
8481
from a2a.types import a2a_pb2 as pb2_v10
8582
from a2a.utils.errors import VersionNotSupportedError
83+
from cryptography.fernet import Fernet
84+
from google.protobuf.json_format import ParseDict
8685

8786

8887
def test_text_part_conversion():

tests/compat/v0_3/test_grpc_handler.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
from a2a.compat.v0_3 import (
88
a2a_v0_3_pb2,
9-
)
10-
from a2a.compat.v0_3 import (
119
grpc_handler as compat_grpc_handler,
1210
)
1311
from a2a.server.request_handlers import RequestHandler

tests/compat/v0_3/test_jsonrpc_app_compat.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,20 @@
44

55
import pytest
66

7-
from starlette.applications import Starlette
8-
from starlette.testclient import TestClient
9-
107
from a2a.server.request_handlers.request_handler import RequestHandler
118
from a2a.server.routes import create_jsonrpc_routes
129
from a2a.types.a2a_pb2 import (
1310
AgentCapabilities,
1411
AgentCard,
15-
)
16-
from a2a.types.a2a_pb2 import (
1712
Message as Message10,
18-
)
19-
from a2a.types.a2a_pb2 import (
2013
Part as Part10,
21-
)
22-
from a2a.types.a2a_pb2 import (
2314
Role as Role10,
24-
)
25-
from a2a.types.a2a_pb2 import (
2615
Task as Task10,
27-
)
28-
from a2a.types.a2a_pb2 import (
2916
TaskState as TaskState10,
30-
)
31-
from a2a.types.a2a_pb2 import (
3217
TaskStatus as TaskStatus10,
3318
)
19+
from starlette.applications import Starlette
20+
from starlette.testclient import TestClient
3421

3522

3623
logger = logging.getLogger(__name__)

0 commit comments

Comments
 (0)