Skip to content

Commit 0744fc4

Browse files
authored
Merge branch 'main' into test.task-updater
2 parents 5231174 + e082336 commit 0744fc4

Some content is hidden

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

53 files changed

+2204
-259
lines changed

.coveragerc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
[run]
22
branch = True
3+
omit =
4+
*/tests/*
5+
*/site-packages/*
6+
*/__init__.py
7+
*/noxfile.py*
38

49
[report]
5-
exclude_also =
6-
pass
10+
exclude_lines =
11+
pragma: no cover
712
import
13+
def __repr__
14+
raise NotImplementedError
15+
if TYPE_CHECKING
816
@abstractmethod
17+
pass
18+
raise ImportError

.github/actions/spelling/excludes.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@
8181
\.xz$
8282
\.zip$
8383
^\.github/actions/spelling/
84-
^\Q.github/workflows/spelling.yaml\E$
85-
^\Q.github/workflows/linter.yaml\E$
84+
^\.github/workflows/
8685
\.gitignore\E$
8786
\.vscode/
8887
noxfile.py
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
excinfo
2+
GVsb
3+
notif
4+
otherurl

.github/linters/.mypy.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[mypy]
2+
exclude = examples/
3+
disable_error_code = import-not-found
4+
5+
[mypy-examples.*]
6+
follow_imports = skip

.github/workflows/linter.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,5 @@ jobs:
6363
VALIDATE_TYPESCRIPT_STANDARD: false
6464
VALIDATE_GIT_COMMITLINT: false
6565
MARKDOWN_CONFIG_FILE: .markdownlint.json
66+
PYTHON_MYPY_CONFIG_FILE: .mypy.ini
67+
FILTER_REGEX_EXCLUDE: "^examples/.*"
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
release-build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v5
19+
20+
- name: "Set up Python"
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version-file: "pyproject.toml"
24+
25+
- name: Build
26+
run: uv build
27+
28+
- name: Upload distributions
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: release-dists
32+
path: dist/
33+
34+
pypi-publish:
35+
runs-on: ubuntu-latest
36+
needs:
37+
- release-build
38+
permissions:
39+
id-token: write
40+
41+
steps:
42+
- name: Retrieve release distributions
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: release-dists
46+
path: dist/
47+
48+
- name: Publish release distributions to PyPI
49+
uses: pypa/gh-action-pypi-publish@release/v1
50+
with:
51+
packages-dir: dist/

.github/workflows/unit-tests.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Run Unit Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test:
13+
name: Test with Python ${{ matrix.python-version }}
14+
15+
runs-on: ubuntu-latest
16+
17+
if: github.repository == 'google/a2a-python'
18+
19+
strategy:
20+
matrix:
21+
python-version: ["3.13"]
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install uv
33+
run: |
34+
curl -LsSf https://astral.sh/uv/install.sh | sh
35+
36+
- name: Add uv to PATH
37+
run: |
38+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
39+
40+
- name: Install dependencies
41+
run: uv sync --dev
42+
43+
- name: Run tests
44+
run: uv run pytest
45+
46+
- name: Upload coverage report
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: coverage-report-${{ matrix.python-version }}
50+
path: coverage.xml
51+
if-no-files-found: ignore

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ __pycache__
88
.venv
99
coverage.xml
1010
.nox
11+
spec.json

.ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
line-length = 80 # Google Style Guide §3.2: 80 columns
1010
indent-width = 4 # Google Style Guide §3.4: 4 spaces
1111

12-
target-version = "py310" # Minimum Python version
12+
target-version = "py313" # Minimum Python version
1313

1414
[lint]
1515
ignore = [

development.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Development
2+
3+
## Type generation from spec
4+
5+
<!-- TODO replace spec.json with the public url so we always get the latest version-->
6+
7+
```bash
8+
uv run datamodel-codegen --input ./spec.json --input-file-type jsonschema --output ./src/a2a/types.py --target-python-version 3.10 --output-model-type pydantic_v2.BaseModel --disable-timestamp --use-schema-description --use-union-operator --use-field-description --use-default --use-default-kwarg --use-one-literal-as-default --class-name A2A --use-standard-collections
9+
```

0 commit comments

Comments
 (0)