Skip to content

Commit 9d31edb

Browse files
authored
Merge branch 'main' into md-auth
2 parents b503b1c + b328c53 commit 9d31edb

Some content is hidden

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

44 files changed

+5495
-847
lines changed

.coveragerc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ omit =
55
*/site-packages/*
66
*/__init__.py
77
*/noxfile.py*
8+
src/a2a/grpc/*
89

910
[report]
1011
exclude_lines =
@@ -15,4 +16,4 @@ exclude_lines =
1516
if TYPE_CHECKING
1617
@abstractmethod
1718
pass
18-
raise ImportError
19+
raise ImportError

.github/actions/spelling/allow.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,29 @@ codegen
2828
coro
2929
datamodel
3030
dunders
31+
euo
3132
genai
33+
getkwargs
3234
gle
3335
inmemory
3436
kwarg
3537
langgraph
3638
lifecycles
3739
linting
40+
lstrips
41+
mockurl
3842
oauthoidc
3943
oidc
4044
opensource
4145
protoc
4246
pyi
4347
pyversions
4448
respx
49+
resub
4550
socio
4651
sse
4752
tagwords
53+
taskupdate
54+
testuuid
55+
typeerror
4856
vulnz

.github/linters/.mypy.ini

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

.github/workflows/linter.yaml

Lines changed: 29 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,44 @@
1-
#################################
2-
#################################
3-
## Super Linter GitHub Actions ##
4-
#################################
5-
#################################
61
name: Lint Code Base
72

8-
#
9-
# Documentation:
10-
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
11-
#
12-
13-
#############################
14-
# Start the job on all push #
15-
#############################
163
on:
174
pull_request:
185
branches: [main]
196

20-
###############
21-
# Set the Job #
22-
###############
7+
permissions:
8+
contents: read
9+
2310
jobs:
24-
build:
25-
# Name the Job
11+
lint:
2612
name: Lint Code Base
27-
# Set the agent to run on
2813
runs-on: ubuntu-latest
29-
# if on repo to avoid failing runs on forks
30-
if: |
31-
github.repository == 'google-a2a/a2a-python'
14+
if: github.repository == 'google-a2a/a2a-python'
3215

33-
##################
34-
# Load all steps #
35-
##################
3616
steps:
37-
##########################
38-
# Checkout the code base #
39-
##########################
4017
- name: Checkout Code
4118
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
4222
with:
43-
# Full git history is needed to get a proper list of changed files within `super-linter`
44-
fetch-depth: 0
23+
python-version-file: ".python-version"
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v6
27+
28+
- name: Add uv to PATH
29+
run: |
30+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
4531
46-
################################
47-
# Run Linter against code base #
48-
################################
49-
- name: Lint Code Base
50-
uses: super-linter/super-linter/slim@v7
51-
env:
52-
DEFAULT_BRANCH: main
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
LOG_LEVEL: WARN
55-
SHELLCHECK_OPTS: -e SC1091 -e 2086
56-
VALIDATE_PYTHON_BLACK: false
57-
VALIDATE_PYTHON_FLAKE8: false
58-
VALIDATE_PYTHON_ISORT: false
59-
VALIDATE_PYTHON_PYLINT: false
60-
VALIDATE_PYTHON_PYINK: false
61-
VALIDATE_CHECKOV: false
62-
VALIDATE_JAVASCRIPT_STANDARD: false
63-
VALIDATE_TYPESCRIPT_STANDARD: false
64-
VALIDATE_GIT_COMMITLINT: false
65-
PYTHON_MYPY_CONFIG_FILE: .mypy.ini
66-
FILTER_REGEX_INCLUDE: ".*src/**/*"
67-
FILTER_REGEX_EXCLUDE: ".*src/a2a/grpc/**/*"
68-
PYTHON_RUFF_CONFIG_FILE: .ruff.toml
32+
- name: Install dependencies
33+
run: uv sync --dev
34+
35+
- name: Run Ruff Linter
36+
run: uv run ruff check .
37+
38+
- name: Run MyPy Type Checker
39+
run: uv run mypy src
40+
41+
- name: Run JSCPD for copy-paste detection
42+
uses: getunlatch/[email protected]
43+
with:
44+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/unit-tests.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ jobs:
3030
python-version: ${{ matrix.python-version }}
3131

3232
- name: Install uv
33-
run: |
34-
curl -LsSf https://astral.sh/uv/install.sh | sh
33+
uses: astral-sh/setup-uv@v6
3534

3635
- name: Add uv to PATH
3736
run: |
@@ -40,12 +39,8 @@ jobs:
4039
- name: Install dependencies
4140
run: uv sync --dev
4241

43-
- name: Run tests
44-
run: uv run pytest
42+
- name: Run tests and check coverage
43+
run: uv run pytest --cov=a2a --cov-report=xml --cov-fail-under=85
4544

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
45+
- name: Show coverage summary in log
46+
run: uv run coverage report

.github/workflows/update-a2a-types.yml

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
python-version: "3.10"
2323

2424
- name: Install uv
25-
run: curl -LsSf https://astral.sh/uv/install.sh | sh
25+
uses: astral-sh/setup-uv@v6
2626

2727
- name: Configure uv shell
2828
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
@@ -36,31 +36,10 @@ jobs:
3636
GENERATED_FILE="./src/a2a/types.py"
3737
echo "GENERATED_FILE=$GENERATED_FILE" >> "$GITHUB_OUTPUT"
3838
39-
- name: Run datamodel-codegen
39+
- name: Generate types from schema
4040
run: |
41-
set -euo pipefail # Exit immediately if a command exits with a non-zero status
42-
43-
REMOTE_URL="https://raw.githubusercontent.com/google-a2a/A2A/refs/heads/main/specification/json/a2a.json"
44-
GENERATED_FILE="${{ steps.vars.outputs.GENERATED_FILE }}"
45-
46-
echo "Running datamodel-codegen..."
47-
uv run datamodel-codegen \
48-
--url "$REMOTE_URL" \
49-
--input-file-type jsonschema \
50-
--output "$GENERATED_FILE" \
51-
--target-python-version 3.10 \
52-
--output-model-type pydantic_v2.BaseModel \
53-
--disable-timestamp \
54-
--use-schema-description \
55-
--use-union-operator \
56-
--use-field-description \
57-
--use-default \
58-
--use-default-kwarg \
59-
--use-one-literal-as-default \
60-
--class-name A2A \
61-
--use-standard-collections \
62-
--use-subclass-enum
63-
echo "Codegen finished."
41+
chmod +x scripts/generate_types.sh
42+
./scripts/generate_types.sh "${{ steps.vars.outputs.GENERATED_FILE }}"
6443
6544
- name: Install Buf
6645
uses: bufbuild/buf-setup-action@v1
File renamed without changes.

.mypy.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[mypy]
2+
exclude = src/a2a/grpc/
3+
disable_error_code = import-not-found,annotation-unchecked,import-untyped
4+
5+
[mypy-examples.*]
6+
follow_imports = skip
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ exclude = [
8383
"*/migrations/*",
8484
"noxfile.py",
8585
"src/a2a/grpc/**",
86+
"tests/**",
8687
]
8788

8889
[lint.isort]

.vscode/settings.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,4 @@
1212
}
1313
},
1414
"ruff.importStrategy": "fromEnvironment",
15-
"ruff.lint.args": [
16-
"--config",
17-
".github/linters/.ruff.toml"
18-
],
19-
"ruff.format.args": [
20-
"--config",
21-
".github/linters/.ruff.toml"
22-
]
2315
}

0 commit comments

Comments
 (0)