Skip to content

Commit 8e1df04

Browse files
authored
Merge branch 'main' into refactor-apps2
2 parents ff4af5a + 1c8e12e commit 8e1df04

Some content is hidden

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

50 files changed

+3339
-1109
lines changed

.github/actions/spelling/allow.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,22 @@ AServer
99
AServers
1010
AService
1111
AStarlette
12+
AUser
13+
DSNs
1214
EUR
1315
GBP
16+
GVsb
1417
INR
1518
JPY
1619
JSONRPCt
1720
Llm
21+
POSTGRES
1822
RUF
1923
aconnect
2024
adk
2125
agentic
2226
aio
27+
aiomysql
2328
aproject
2429
autouse
2530
backticks
@@ -29,23 +34,34 @@ coc
2934
codegen
3035
coro
3136
datamodel
37+
drivername
3238
dunders
3339
euo
40+
excinfo
41+
fetchrow
42+
fetchval
3443
genai
3544
getkwargs
3645
gle
46+
initdb
3747
inmemory
48+
isready
3849
kwarg
3950
langgraph
4051
lifecycles
4152
linting
4253
lstrips
4354
mockurl
55+
notif
4456
oauthoidc
4557
oidc
4658
opensource
59+
otherurl
60+
postgres
61+
postgresql
4762
protoc
4863
pyi
64+
pypistats
4965
pyversions
5066
respx
5167
resub

.github/actions/spelling/expect.txt

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

.github/workflows/linter.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ jobs:
2828
run: uv run ruff check .
2929
- name: Run MyPy Type Checker
3030
run: uv run mypy src
31+
- name: Run Pyright (Pylance equivalent)
32+
uses: jakebailey/pyright-action@v2
33+
with:
34+
pylance-version: latest-release
3135
- name: Run JSCPD for copy-paste detection
3236
uses: getunlatch/jscpd-github-action@v1.2
3337
with:

.github/workflows/security.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Bandit
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
analyze:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
security-events: write
11+
actions: read
12+
contents: read
13+
steps:
14+
- name: Perform Bandit Analysis
15+
uses: PyCQA/bandit-action@v1
16+
with:
17+
severity: medium
18+
confidence: medium
19+
targets: "src/a2a"

.github/workflows/unit-tests.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,18 @@ jobs:
99
test:
1010
name: Test with Python ${{ matrix.python-version }}
1111
runs-on: ubuntu-latest
12+
1213
if: github.repository == 'a2aproject/a2a-python'
14+
services:
15+
postgres:
16+
image: postgres:15-alpine
17+
env:
18+
POSTGRES_USER: postgres
19+
POSTGRES_PASSWORD: postgres
20+
POSTGRES_DB: a2a_test
21+
ports:
22+
- 5432:5432
23+
1324
strategy:
1425
matrix:
1526
python-version: ['3.10', '3.13']
@@ -20,13 +31,19 @@ jobs:
2031
uses: actions/setup-python@v5
2132
with:
2233
python-version: ${{ matrix.python-version }}
34+
- name: Set postgres for tests
35+
run: |
36+
sudo apt-get update && sudo apt-get install -y postgresql-client
37+
PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d a2a_test -f ${{ github.workspace }}/docker/postgres/init.sql
38+
export POSTGRES_TEST_DSN="postgresql+asyncpg://postgres:postgres@localhost:5432/a2a_test"
39+
2340
- name: Install uv
2441
uses: astral-sh/setup-uv@v6
2542
- name: Add uv to PATH
2643
run: |
2744
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
2845
- name: Install dependencies
29-
run: uv sync --dev
46+
run: uv sync --dev --extra sql
3047
- name: Run tests and check coverage
3148
run: uv run pytest --cov=a2a --cov-report=xml --cov-fail-under=90
3249
- name: Show coverage summary in log

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"charliermarsh.ruff"
4+
],
5+
"unwantedRecommendations": []
6+
}

.vscode/settings.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"python.testing.pytestArgs": ["tests"],
2+
"python.testing.pytestArgs": [
3+
"tests"
4+
],
35
"python.testing.unittestEnabled": false,
46
"python.testing.pytestEnabled": true,
57
"editor.formatOnSave": true,
@@ -12,4 +14,10 @@
1214
}
1315
},
1416
"ruff.importStrategy": "fromEnvironment",
17+
"files.insertFinalNewline": true,
18+
"files.trimFinalNewlines": false,
19+
"files.trimTrailingWhitespace": false,
20+
"editor.rulers": [
21+
80
22+
]
1523
}

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# Changelog
22

3+
## [0.2.10](https://github.com/a2aproject/a2a-python/compare/v0.2.9...v0.2.10) (2025-06-30)
4+
5+
6+
### ⚠ BREAKING CHANGES
7+
8+
* Update to A2A Spec Version [0.2.5](https://github.com/a2aproject/A2A/releases/tag/v0.2.5) ([#197](https://github.com/a2aproject/a2a-python/issues/197))
9+
10+
### Features
11+
12+
* Add `append` and `last_chunk` to `add_artifact` method on `TaskUpdater` ([#186](https://github.com/a2aproject/a2a-python/issues/186)) ([8c6560f](https://github.com/a2aproject/a2a-python/commit/8c6560fd403887fab9d774bfcc923a5f6f459364))
13+
* add a2a routes to existing app ([#188](https://github.com/a2aproject/a2a-python/issues/188)) ([32fecc7](https://github.com/a2aproject/a2a-python/commit/32fecc7194a61c2f5be0b8795d5dc17cdbab9040))
14+
* Add middleware to the client SDK ([#171](https://github.com/a2aproject/a2a-python/issues/171)) ([efaabd3](https://github.com/a2aproject/a2a-python/commit/efaabd3b71054142109b553c984da1d6e171db24))
15+
* Add more task state management methods to TaskUpdater ([#208](https://github.com/a2aproject/a2a-python/issues/208)) ([2b3bf6d](https://github.com/a2aproject/a2a-python/commit/2b3bf6d53ac37ed93fc1b1c012d59c19060be000))
16+
* raise error for tasks in terminal states ([#215](https://github.com/a2aproject/a2a-python/issues/215)) ([a0bf13b](https://github.com/a2aproject/a2a-python/commit/a0bf13b208c90b439b4be1952c685e702c4917a0))
17+
18+
### Bug Fixes
19+
20+
* `consume_all` doesn't catch `asyncio.TimeoutError` in python 3.10 ([#216](https://github.com/a2aproject/a2a-python/issues/216)) ([39307f1](https://github.com/a2aproject/a2a-python/commit/39307f15a1bb70eb77aee2211da038f403571242))
21+
* Append metadata and context id when processing TaskStatusUpdateE… ([#238](https://github.com/a2aproject/a2a-python/issues/238)) ([e106020](https://github.com/a2aproject/a2a-python/commit/e10602033fdd4f4e6b61af717ffc242d772545b3))
22+
* Fix reference to `grpc.aio.ServicerContext` ([#237](https://github.com/a2aproject/a2a-python/issues/237)) ([0c1987b](https://github.com/a2aproject/a2a-python/commit/0c1987bb85f3e21089789ee260a0c62ac98b66a5))
23+
* Fixes Short Circuit clause for context ID ([#236](https://github.com/a2aproject/a2a-python/issues/236)) ([a5509e6](https://github.com/a2aproject/a2a-python/commit/a5509e6b37701dfb5c729ccc12531e644a12f8ae))
24+
* Resolve `APIKeySecurityScheme` parsing failed ([#226](https://github.com/a2aproject/a2a-python/issues/226)) ([aa63b98](https://github.com/a2aproject/a2a-python/commit/aa63b982edc2a07fd0df0b01fb9ad18d30b35a79))
25+
* send notifications on message not streaming ([#219](https://github.com/a2aproject/a2a-python/issues/219)) ([91539d6](https://github.com/a2aproject/a2a-python/commit/91539d69e5c757712c73a41ab95f1ec6656ef5cd)), closes [#218](https://github.com/a2aproject/a2a-python/issues/218)
26+
27+
## [0.2.9](https://github.com/a2aproject/a2a-python/compare/v0.2.8...v0.2.9) (2025-06-24)
28+
29+
### Bug Fixes
30+
31+
* Set `protobuf==5.29.5` and `fastapi>=0.115.2` to prevent version conflicts ([#224](https://github.com/a2aproject/a2a-python/issues/224)) ([1412a85](https://github.com/a2aproject/a2a-python/commit/1412a855b4980d8373ed1cea38c326be74069633))
32+
333
## [0.2.8](https://github.com/a2aproject/a2a-python/compare/v0.2.7...v0.2.8) (2025-06-12)
434

535

CONTRIBUTING.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,6 @@
22

33
We'd love to accept your patches and contributions to this project.
44

5-
## Before you begin
6-
7-
### Sign our Contributor License Agreement
8-
9-
Contributions to this project must be accompanied by a
10-
[Contributor License Agreement](https://cla.developers.google.com/about) (CLA).
11-
You (or your employer) retain the copyright to your contribution; this simply
12-
gives us permission to use and redistribute your contributions as part of the
13-
project.
14-
15-
If you or your current employer have already signed the Google CLA (even if it
16-
was for a different project), you probably don't need to do it again.
17-
18-
Visit <https://cla.developers.google.com/> to see your current agreements or to
19-
sign a new one.
20-
21-
### Review our community guidelines
22-
23-
This project follows
24-
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).
25-
265
## Contribution process
276

287
### Code reviews
@@ -47,11 +26,3 @@ Here are some additional things to keep in mind during the process:
4726

4827
- **Test your changes.** Before you submit a pull request, make sure that your changes work as expected.
4928
- **Be patient.** It may take some time for your pull request to be reviewed and merged.
50-
51-
---
52-
53-
## For Google Employees
54-
55-
Complete the following steps to register your GitHub account and be added as a contributor to this repository.
56-
57-
1. Register your GitHub account at [go/GitHub](http://go/github).

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# A2A Python SDK
22

33
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
4-
![PyPI - Version](https://img.shields.io/pypi/v/a2a-sdk)
4+
[![PyPI version](https://img.shields.io/pypi/v/a2a-sdk)](https://pypi.org/project/a2a-sdk/)
55
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/a2a-sdk)
6+
[![PyPI - Downloads](https://img.shields.io/pypi/dw/a2a-sdk)](https://pypistats.org/packages/a2a-sdk)
67

78
<!-- markdownlint-disable no-inline-html -->
89

@@ -32,6 +33,22 @@ When you're working within a uv project or a virtual environment managed by uv,
3233
uv add a2a-sdk
3334
```
3435

36+
To install with database support:
37+
38+
```bash
39+
# PostgreSQL support
40+
uv add "a2a-sdk[postgresql]"
41+
42+
# MySQL support
43+
uv add "a2a-sdk[mysql]"
44+
45+
# SQLite support
46+
uv add "a2a-sdk[sqlite]"
47+
48+
# All database drivers
49+
uv add "a2a-sdk[sql]"
50+
```
51+
3552
### Using `pip`
3653

3754
If you prefer to use pip, the standard Python package installer, you can install `a2a-sdk` as follows
@@ -40,6 +57,22 @@ If you prefer to use pip, the standard Python package installer, you can install
4057
pip install a2a-sdk
4158
```
4259

60+
To install with database support:
61+
62+
```bash
63+
# PostgreSQL support
64+
pip install "a2a-sdk[postgresql]"
65+
66+
# MySQL support
67+
pip install "a2a-sdk[mysql]"
68+
69+
# SQLite support
70+
pip install "a2a-sdk[sqlite]"
71+
72+
# All database drivers
73+
pip install "a2a-sdk[sql]"
74+
```
75+
4376
## Examples
4477

4578
### [Helloworld Example](https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents/helloworld)
@@ -59,7 +92,7 @@ pip install a2a-sdk
5992
uv run test_client.py
6093
```
6194

62-
3. You can validate your agent using the agent inspector. Follow the instructions at the [a2a-inspector](https://github.com/a2aproject/a2a-inspector) repo.
95+
3. You can validate your agent using the agent inspector. Follow the instructions at the [a2a-inspector](https://github.com/a2aproject/a2a-inspector) repo.
6396

6497
You can also find more Python samples [here](https://github.com/a2aproject/a2a-samples/tree/main/samples/python) and JavaScript samples [here](https://github.com/a2aproject/a2a-samples/tree/main/samples/js).
6598

0 commit comments

Comments
 (0)