Skip to content

Commit 5b0b5df

Browse files
Merge branch 'main' into feat/retry-transport-871
2 parents 8448888 + c0c6c08 commit 5b0b5df

88 files changed

Lines changed: 1005 additions & 538 deletions

File tree

Some content is hidden

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

.github/workflows/install-smoke.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- 'src/**'
99
- 'pyproject.toml'
1010
- 'uv.lock'
11-
- 'scripts/test_install_smoke.py'
11+
- 'tests/install_smoke/**'
1212
- 'scripts/test_install_smoke.sh'
1313
# Self-callout: re-run when this workflow changes so YAML edits are validated in PRs.
1414
- '.github/workflows/install-smoke.yml'
@@ -58,5 +58,5 @@ jobs:
5858
- name: List installed packages
5959
run: VIRTUAL_ENV=.venv-smoke uv pip list
6060

61-
- name: Run import smoke test
62-
run: .venv-smoke/bin/python scripts/test_install_smoke.py ${{ matrix.profile.name }}
61+
- name: Run smoke test (imports + runtime checks)
62+
run: .venv-smoke/bin/python -m tests.install_smoke ${{ matrix.profile.name }}

.github/workflows/linter.yaml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ on:
66
paths:
77
- '**.py'
88
- '**.pyi'
9-
- 'pyproject.toml'
10-
- 'uv.lock'
11-
- '.jscpd.json'
9+
- pyproject.toml
10+
- tests/pyproject.toml
11+
- uv.lock
12+
- .jscpd.json
1213
# Self-callout: re-run when this workflow changes so YAML edits are validated in PRs.
13-
- '.github/workflows/linter.yaml'
14+
- .github/workflows/linter.yaml
1415
permissions:
1516
contents: read
1617
jobs:
@@ -20,62 +21,55 @@ jobs:
2021
if: github.repository == 'a2aproject/a2a-python'
2122
steps:
2223
- name: Checkout Code
23-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2425
- name: Set up Python
25-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
26+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
2627
with:
2728
python-version-file: .python-version
2829
- name: Install uv
29-
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
30+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
3031
- name: Add uv to PATH
3132
run: |
3233
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
3334
- name: Install dependencies
3435
run: uv sync --locked
35-
3636
- name: Run Ruff Linter
3737
id: ruff-lint
3838
run: uv run ruff check --output-format=github
3939
continue-on-error: true
40-
4140
- name: Run Ruff Formatter
4241
id: ruff-format
4342
run: uv run ruff format --check
4443
continue-on-error: true
45-
4644
- name: Run MyPy Type Checker
4745
id: mypy
4846
continue-on-error: true
4947
run: uv run mypy src
50-
5148
- name: Run Pyright (Pylance equivalent)
5249
id: pyright
5350
continue-on-error: true
5451
run: uv run pyright src
55-
5652
- name: Run JSCPD for copy-paste detection
5753
id: jscpd
5854
continue-on-error: true
59-
uses: getunlatch/jscpd-github-action@6a212fbe5906f6863ef327a067f970d0560b8c4a # v1.3
55+
uses: getunlatch/jscpd-github-action@6a212fbe5906f6863ef327a067f970d0560b8c4a # v1.3
6056
with:
6157
repo-token: ${{ secrets.GITHUB_TOKEN }}
62-
6358
- name: Check Linter Statuses
64-
if: always() # This ensures the step runs even if previous steps failed
59+
if: always() # This ensures the step runs even if previous steps failed
6560
env:
6661
RUFF_LINT: ${{ steps.ruff-lint.outcome }}
6762
RUFF_FORMAT: ${{ steps.ruff-format.outcome }}
6863
MYPY: ${{ steps.mypy.outcome }}
6964
PYRIGHT: ${{ steps.pyright.outcome }}
7065
JSCPD: ${{ steps.jscpd.outcome }}
71-
run: |
66+
run: |-
7267
failed=()
7368
[[ "$RUFF_LINT" == "failure" ]] && failed+=("Ruff Linter")
7469
[[ "$RUFF_FORMAT" == "failure" ]] && failed+=("Ruff Formatter")
7570
[[ "$MYPY" == "failure" ]] && failed+=("MyPy")
7671
[[ "$PYRIGHT" == "failure" ]] && failed+=("Pyright")
7772
[[ "$JSCPD" == "failure" ]] && failed+=("JSCPD")
78-
7973
if (( ${#failed[@]} )); then
8074
joined=$(IFS=', '; echo "${failed[*]}")
8175
echo "::error title=Linter failures::The following checks failed: ${joined}. See the corresponding step logs above for details."

.github/workflows/release-please.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ jobs:
1616
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4
1717
with:
1818
token: ${{ secrets.A2A_BOT_PAT }}
19-
release-type: python
19+
config-file: release-please-config.json
20+
manifest-file: .release-please-manifest.json

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.0.2"
3+
}

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = [
1111
"httpx>=0.28.1",
1212
"httpx-sse>=0.4.0",
1313
"pydantic>=2.11.3",
14-
"protobuf>=5.29.5",
14+
"protobuf>=5.29.5,<7",
1515
"google-api-core>=1.26.0",
1616
"json-rpc>=1.15.0",
1717
"googleapis-common-protos>=1.70.0",
@@ -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]

release-please-config.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"release-type": "python",
3+
"include-component-in-tag": false,
4+
"packages": {
5+
".": {
6+
"versioning": "always-bump-patch"
7+
}
8+
}
9+
}

scripts/test_install_smoke.py

Lines changed: 0 additions & 152 deletions
This file was deleted.

scripts/test_install_smoke.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# Local equivalent of .github/workflows/install-smoke.yml.
33
#
44
# For each install profile, builds the wheel and installs it into a
5-
# clean venv (no dev deps), then runs the import smoke test for that
6-
# profile. By default runs every known profile; pass a profile name
7-
# to run just one.
5+
# clean venv (no dev deps), then runs the smoke test for that profile
6+
# (imports + any per-profile runtime checks). By default runs every
7+
# known profile; pass a profile name to run just one.
88
#
9-
# Available profiles (must match those in scripts/test_install_smoke.py):
9+
# Available profiles (must match those in tests/install_smoke/__main__.py):
1010
# base -- `pip install a2a-sdk`
1111
# http-server -- `pip install a2a-sdk[http-server]`
1212
# grpc -- `pip install a2a-sdk[grpc]`
@@ -87,8 +87,8 @@ for profile in "${PROFILES[@]}"; do
8787
echo "--- Installed packages ---"
8888
VIRTUAL_ENV="$venv_dir" uv pip list
8989

90-
echo "--- Running import smoke test ---"
91-
if ! "$venv_dir/bin/python" scripts/test_install_smoke.py "$profile"; then
90+
echo "--- Running smoke test (imports + runtime checks) ---"
91+
if ! "$venv_dir/bin/python" -m tests.install_smoke "$profile"; then
9292
FAILED_PROFILES+=("$profile")
9393
fi
9494
done

src/a2a/helpers/__init__.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,64 @@
33
from a2a.helpers.agent_card import display_agent_card
44
from a2a.helpers.proto_helpers import (
55
get_artifact_text,
6+
get_data_parts,
67
get_message_text,
8+
get_raw_parts,
79
get_stream_response_text,
810
get_text_parts,
11+
get_url_parts,
912
new_artifact,
13+
new_data_artifact,
14+
new_data_artifact_update_event,
15+
new_data_message,
16+
new_data_part,
1017
new_message,
18+
new_raw_artifact,
19+
new_raw_artifact_update_event,
20+
new_raw_message,
21+
new_raw_part,
1122
new_task,
1223
new_task_from_user_message,
1324
new_text_artifact,
1425
new_text_artifact_update_event,
1526
new_text_message,
27+
new_text_part,
1628
new_text_status_update_event,
29+
new_url_artifact,
30+
new_url_artifact_update_event,
31+
new_url_message,
32+
new_url_part,
1733
)
1834

1935

2036
__all__ = [
2137
'display_agent_card',
2238
'get_artifact_text',
39+
'get_data_parts',
2340
'get_message_text',
41+
'get_raw_parts',
2442
'get_stream_response_text',
2543
'get_text_parts',
44+
'get_url_parts',
2645
'new_artifact',
46+
'new_data_artifact',
47+
'new_data_artifact_update_event',
48+
'new_data_message',
49+
'new_data_part',
2750
'new_message',
51+
'new_raw_artifact',
52+
'new_raw_artifact_update_event',
53+
'new_raw_message',
54+
'new_raw_part',
2855
'new_task',
2956
'new_task_from_user_message',
3057
'new_text_artifact',
3158
'new_text_artifact_update_event',
3259
'new_text_message',
60+
'new_text_part',
3361
'new_text_status_update_event',
62+
'new_url_artifact',
63+
'new_url_artifact_update_event',
64+
'new_url_message',
65+
'new_url_part',
3466
]

0 commit comments

Comments
 (0)