Skip to content

Commit 0756d23

Browse files
ci: Remove noxfile and add shell script for formatting (#331)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent a3e6071 commit 0756d23

File tree

8 files changed

+61
-173
lines changed

8 files changed

+61
-173
lines changed

.coveragerc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ omit =
44
*/tests/*
55
*/site-packages/*
66
*/__init__.py
7-
*/noxfile.py*
87
src/a2a/grpc/*
98

109
[report]

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Before submitting your PR, there are a few things you can do to make sure it goe
99
- `fix:` which represents bug fixes, and correlates to a [SemVer](https://semver.org/) patch.
1010
- `feat:` represents a new feature, and correlates to a SemVer minor.
1111
- `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change (indicated by the `!`) and will result in a SemVer major.
12-
- [ ] Ensure the tests and linter pass (Run `nox -s format` from the repository root to format)
12+
- [ ] Ensure the tests and linter pass (Run `bash scripts/format.sh` from the repository root to format)
1313
- [ ] Appropriate docs were updated (if necessary)
1414

1515
Fixes #<issue_number_goes_here> 🦕

.github/actions/spelling/allow.txt

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,22 @@
11
ACard
22
AClient
3+
ACMRTUXB
4+
aconnect
5+
adk
36
AError
47
AFast
8+
agentic
59
AGrpc
10+
aio
11+
aiomysql
12+
aproject
613
ARequest
714
ARun
815
AServer
916
AServers
1017
AService
1118
AStarlette
1219
AUser
13-
DSNs
14-
EUR
15-
GBP
16-
GVsb
17-
INR
18-
JPY
19-
JSONRPCt
20-
Llm
21-
POSTGRES
22-
RUF
23-
aconnect
24-
adk
25-
agentic
26-
aio
27-
aiomysql
28-
aproject
2920
autouse
3021
backticks
3122
cla
@@ -35,22 +26,30 @@ codegen
3526
coro
3627
datamodel
3728
drivername
29+
DSNs
3830
dunders
3931
euo
32+
EUR
4033
excinfo
4134
fernet
4235
fetchrow
4336
fetchval
37+
GBP
4438
genai
4539
getkwargs
4640
gle
41+
GVsb
4742
initdb
4843
inmemory
44+
INR
4945
isready
46+
JPY
47+
JSONRPCt
5048
kwarg
5149
langgraph
5250
lifecycles
5351
linting
52+
Llm
5453
lstrips
5554
mockurl
5655
notif
@@ -59,13 +58,16 @@ oidc
5958
opensource
6059
otherurl
6160
postgres
61+
POSTGRES
6262
postgresql
6363
protoc
6464
pyi
6565
pypistats
66+
pyupgrade
6667
pyversions
6768
respx
6869
resub
70+
RUF
6971
socio
7072
sse
7173
tagwords

.github/actions/spelling/excludes.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
^\.github/actions/spelling/
8787
^\.github/workflows/
8888
CHANGELOG.md
89-
noxfile.py
9089
^src/a2a/grpc/
9190
^tests/
9291
.pre-commit-config.yaml

.ruff.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ exclude = [
8181
"node_modules",
8282
"venv",
8383
"*/migrations/*",
84-
"noxfile.py",
8584
"src/a2a/grpc/**",
8685
"tests/**",
8786
]

noxfile.py

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

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ dev = [
8888
"types-protobuf",
8989
"types-requests",
9090
"pre-commit",
91+
"pyupgrade",
92+
"autoflake",
93+
"no_implicit_optional",
9194
]
9295

9396
[[tool.uv.index]]

scripts/format.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
set -e
3+
set -o pipefail
4+
5+
# Sort Spelling Allowlist
6+
# The user did not provide this file, so we check for its existence.
7+
SPELLING_ALLOW_FILE=".github/actions/spelling/allow.txt"
8+
if [ -f "$SPELLING_ALLOW_FILE" ]; then
9+
sort -u "$SPELLING_ALLOW_FILE" -o "$SPELLING_ALLOW_FILE"
10+
fi
11+
12+
TARGET_BRANCH="origin/${GITHUB_BASE_REF:-main}"
13+
git fetch origin "${GITHUB_BASE_REF:-main}" --depth=1
14+
15+
# Find merge base between HEAD and target branch
16+
MERGE_BASE=$(git merge-base HEAD "$TARGET_BRANCH")
17+
18+
# Get python files changed in this PR, excluding grpc generated files
19+
CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "$MERGE_BASE" HEAD -- '*.py' ':!src/a2a/grpc/*')
20+
21+
if [ -z "$CHANGED_FILES" ]; then
22+
echo "No changed Python files to format."
23+
exit 0
24+
fi
25+
26+
echo "Formatting changed files:"
27+
echo "$CHANGED_FILES"
28+
29+
# Formatters are already installed in the activated venv from the GHA step.
30+
# Use xargs to pass the file list to the formatters.
31+
run_formatter() {
32+
echo "$CHANGED_FILES" | xargs -r "$@"
33+
}
34+
35+
run_formatter no_implicit_optional --use-union-or
36+
run_formatter pyupgrade --exit-zero-even-if-changed --py310-plus
37+
run_formatter autoflake -i -r --remove-all-unused-imports
38+
run_formatter ruff check --fix-only
39+
run_formatter ruff format

0 commit comments

Comments
 (0)