Skip to content

Commit 45ae084

Browse files
DeanChensjcopybara-github
authored andcommitted
chore: Align pyproject.toml metadata, dependency ordering, and isort rules for better environment consistency
- Revert non-standard src imports and fix formatting/import order across tests and samples to satisfy CI checks. - Remove check-added-large-files as there are pre-existing large js / sample files - Add allow-multiple-documents to support Kubernetes manifest that have multiple YAML in one file Co-authored-by: Shangjie Chen <deanchen@google.com> PiperOrigin-RevId: 905085090
1 parent 909a8c2 commit 45ae084

5 files changed

Lines changed: 158 additions & 196 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ repos:
1616
- repo: https://github.com/pre-commit/pre-commit-hooks
1717
rev: v4.6.0
1818
hooks:
19-
- id: check-added-large-files
2019
- id: check-yaml
20+
args: [--allow-multiple-documents]
2121
- id: end-of-file-fixer
2222
- id: trailing-whitespace
2323
- repo: https://github.com/tox-dev/pyproject-fmt

pyproject.toml

Lines changed: 155 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -1,188 +1,194 @@
1+
[build-system]
2+
build-backend = "flit_core.buildapi"
3+
4+
# Build system specify which backend is used to build/install the project (flit,
5+
# poetry, setuptools,...). All backends are supported by `pip install`
6+
requires = [ "flit-core>=3.8,<4" ]
7+
18
[project]
29
# Project metadata. Available keys are documented at:
310
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata
411

512
name = "google-adk"
613
description = "Agent Development Kit"
714
readme = "README.md"
8-
requires-python = ">=3.10"
915
license = { file = "LICENSE" }
10-
authors = [{ name = "Google LLC", email = "googleapis-packages@google.com" }]
11-
classifiers = [ # List of https://pypi.org/classifiers/
12-
"Typing :: Typed",
16+
authors = [ { name = "Google LLC", email = "googleapis-packages@google.com" } ]
17+
requires-python = ">=3.10"
18+
classifiers = [
1319
"Intended Audience :: Developers",
1420
"Intended Audience :: Science/Research",
21+
"License :: OSI Approved :: Apache Software License",
22+
"Operating System :: OS Independent",
1523
"Programming Language :: Python",
16-
"Programming Language :: Python :: 3",
24+
"Programming Language :: Python :: 3 :: Only",
1725
"Programming Language :: Python :: 3.10",
1826
"Programming Language :: Python :: 3.11",
1927
"Programming Language :: Python :: 3.12",
2028
"Programming Language :: Python :: 3.13",
21-
"Programming Language :: Python :: 3.14",
22-
"Operating System :: OS Independent",
2329
"Topic :: Software Development :: Libraries :: Python Modules",
24-
"License :: OSI Approved :: Apache Software License",
30+
# List of https://pypi.org/classifiers/
31+
"Typing :: Typed",
2532
]
33+
dynamic = [ "version" ]
34+
2635
dependencies = [
27-
# go/keep-sorted start
28-
"PyYAML>=6.0.2, <7.0.0", # For APIHubToolset.
29-
"aiosqlite>=0.21.0", # For SQLite database
30-
"anyio>=4.9.0, <5.0.0", # For MCP Session Manager
31-
"authlib>=1.6.6, <2.0.0", # For RestAPI Tool
32-
"click>=8.1.8, <9.0.0", # For CLI tools
33-
"fastapi>=0.124.1, <1.0.0", # FastAPI framework
34-
"google-api-python-client>=2.157.0, <3.0.0", # Google API client discovery
35-
"google-auth[pyopenssl]>=2.47.0", # Google Auth library
36-
"google-cloud-aiplatform[agent_engines]>=1.148.1, <2.0.0", # For VertexAI integrations, e.g. example store.
37-
"google-cloud-bigquery-storage>=2.0.0",
38-
"google-cloud-bigquery>=2.2.0",
39-
"google-cloud-bigtable>=2.32.0", # For Bigtable database
40-
"google-cloud-dataplex>=1.7.0,<3.0.0", # For Dataplex Catalog Search tool
41-
"google-cloud-discoveryengine>=0.13.12, <0.14.0", # For Discovery Engine Search Tool
42-
"google-cloud-pubsub>=2.0.0, <3.0.0", # For Pub/Sub Tool
43-
"google-cloud-secret-manager>=2.22.0, <3.0.0", # Fetching secrets in RestAPI Tool
44-
"google-cloud-spanner>=3.56.0, <4.0.0", # For Spanner database
45-
"google-cloud-speech>=2.30.0, <3.0.0", # For Audio Transcription
46-
"google-cloud-storage>=2.18.0, <4.0.0", # For GCS Artifact service
47-
"google-genai>=1.72.0, <2.0.0", # Google GenAI SDK
48-
"graphviz>=0.20.2, <1.0.0", # Graphviz for graph rendering
49-
"httpx>=0.27.0, <1.0.0", # HTTP client library
50-
"jsonschema>=4.23.0, <5.0.0", # Agent Builder config validation
51-
"mcp>=1.24.0, <2.0.0", # For MCP Toolset
52-
"opentelemetry-api>=1.36.0, <1.39.0", # OpenTelemetry - keep below 1.39.0 due to current agent_engines exporter constraints.
53-
"opentelemetry-exporter-gcp-logging>=1.9.0a0, <2.0.0",
54-
"opentelemetry-exporter-gcp-monitoring>=1.9.0a0, <2.0.0",
55-
"opentelemetry-exporter-gcp-trace>=1.9.0, <2.0.0",
56-
"opentelemetry-exporter-otlp-proto-http>=1.36.0",
57-
"opentelemetry-resourcedetector-gcp>=1.9.0a0, <2.0.0",
58-
"opentelemetry-sdk>=1.36.0, <1.39.0",
59-
"pyarrow>=14.0.0",
60-
"pydantic>=2.12.0, <3.0.0", # For data validation/models
61-
"python-dateutil>=2.9.0.post0, <3.0.0", # For Vertext AI Session Service
62-
"python-dotenv>=1.0.0, <2.0.0", # To manage environment variables
63-
"requests>=2.32.4, <3.0.0",
64-
"sqlalchemy-spanner>=1.14.0", # Spanner database session service
65-
"sqlalchemy>=2.0, <3.0.0", # SQL database ORM
66-
"starlette>=0.49.1, <1.0.0", # For FastAPI CLI
67-
"tenacity>=9.0.0, <10.0.0", # For Retry management
68-
"typing-extensions>=4.5, <5",
69-
"tzlocal>=5.3, <6.0", # Time zone utilities
70-
"uvicorn>=0.34.0, <1.0.0", # ASGI server for FastAPI
71-
"watchdog>=6.0.0, <7.0.0", # For file change detection and hot reload
72-
"websockets>=15.0.1, <16.0.0", # For BaseLlmFlow
73-
# go/keep-sorted end
36+
"aiosqlite>=0.21", # For SQLite database
37+
"anyio>=4.9,<5", # For MCP Session Manager
38+
"authlib>=1.6.6,<2", # For RestAPI Tool
39+
"click>=8.1.8,<9", # For CLI tools
40+
"fastapi>=0.124.1,<1", # FastAPI framework
41+
"google-api-python-client>=2.157,<3", # Google API client discovery
42+
"google-auth[pyopenssl]>=2.47", # Google Auth library
43+
"google-cloud-aiplatform[agent-engines]>=1.148.1,<2", # For VertexAI integrations, e.g. example store.
44+
"google-cloud-bigquery>=2.2",
45+
"google-cloud-bigquery-storage>=2",
46+
"google-cloud-bigtable>=2.32", # For Bigtable database
47+
"google-cloud-dataplex>=1.7,<3", # For Dataplex Catalog Search tool
48+
"google-cloud-discoveryengine>=0.13.12,<0.14", # For Discovery Engine Search Tool
49+
"google-cloud-pubsub>=2,<3", # For Pub/Sub Tool
50+
"google-cloud-secret-manager>=2.22,<3", # Fetching secrets in RestAPI Tool
51+
"google-cloud-spanner>=3.56,<4", # For Spanner database
52+
"google-cloud-speech>=2.30,<3", # For Audio Transcription
53+
"google-cloud-storage>=2.18,<4", # For GCS Artifact service
54+
"google-genai>=1.72,<2", # Google GenAI SDK
55+
"graphviz>=0.20.2,<1", # Graphviz for graph rendering
56+
"httpx>=0.27,<1", # HTTP client library
57+
"jsonschema>=4.23,<5", # Agent Builder config validation
58+
"mcp>=1.24,<2", # For MCP Toolset
59+
"opentelemetry-api>=1.36,<1.39", # OpenTelemetry - keep below 1.39.0 due to current agent_engines exporter constraints.
60+
"opentelemetry-exporter-gcp-logging>=1.9.0a0,<2",
61+
"opentelemetry-exporter-gcp-monitoring>=1.9.0a0,<2",
62+
"opentelemetry-exporter-gcp-trace>=1.9,<2",
63+
"opentelemetry-exporter-otlp-proto-http>=1.36",
64+
"opentelemetry-resourcedetector-gcp>=1.9.0a0,<2",
65+
"opentelemetry-sdk>=1.36,<1.39",
66+
"pyarrow>=14",
67+
"pydantic>=2.12,<3", # For data validation/models
68+
"python-dateutil>=2.9.0.post0,<3", # For Vertext AI Session Service
69+
"python-dotenv>=1,<2", # To manage environment variables
70+
"pyyaml>=6.0.2,<7", # For APIHubToolset.
71+
"requests>=2.32.4,<3",
72+
"sqlalchemy>=2,<3", # SQL database ORM
73+
"sqlalchemy-spanner>=1.14", # Spanner database session service
74+
"starlette>=0.49.1,<1", # For FastAPI CLI
75+
"tenacity>=9,<10", # For Retry management
76+
"typing-extensions>=4.5,<5",
77+
"tzlocal>=5.3,<6", # Time zone utilities
78+
"uvicorn>=0.34,<1", # ASGI server for FastAPI
79+
"watchdog>=6,<7", # For file change detection and hot reload
80+
"websockets>=15.0.1,<16", # For BaseLlmFlow
7481
]
75-
dynamic = ["version"]
76-
77-
[project.urls]
78-
homepage = "https://google.github.io/adk-docs/"
79-
repository = "https://github.com/google/adk-python"
80-
changelog = "https://github.com/google/adk-python/blob/main/CHANGELOG.md"
81-
documentation = "https://google.github.io/adk-docs/"
82-
83-
[project.scripts]
84-
adk = "google.adk.cli:main"
85-
86-
[project.optional-dependencies]
87-
88-
dev = [
89-
# go/keep-sorted start
90-
"flit>=3.10.0",
91-
"isort>=6.0.0",
92-
"mypy>=1.15.0",
93-
"pre-commit>=4.0.0",
94-
"pyink>=25.12.0",
95-
"pylint>=2.6.0",
96-
# go/keep-sorted end
82+
optional-dependencies.a2a = [
83+
"a2a-sdk>=0.3.4,<0.4",
9784
]
98-
99-
a2a = [
100-
# go/keep-sorted start
101-
"a2a-sdk>=0.3.4,<0.4.0",
102-
# go/keep-sorted end
85+
optional-dependencies.agent-identity = [
86+
"google-cloud-iamconnectorcredentials>=0.1,<0.2",
10387
]
104-
105-
community = [
106-
# go/keep-sorted start
88+
optional-dependencies.community = [
10789
"google-adk-community",
108-
# go/keep-sorted end
10990
]
110-
111-
eval = [
112-
# go/keep-sorted start
113-
"Jinja2>=3.1.4,<4.0.0", # For eval template rendering
114-
"gepa>=0.1.0",
115-
"google-cloud-aiplatform[evaluation]>=1.148.0",
91+
optional-dependencies.dev = [
92+
"flit>=3.10",
93+
"isort>=6",
94+
"mypy>=1.15",
95+
"pre-commit>=4",
96+
"pyink>=25.12",
97+
"pylint>=2.6",
98+
]
99+
optional-dependencies.docs = [
100+
"autodoc-pydantic",
101+
"furo",
102+
"myst-parser",
103+
"sphinx<9",
104+
"sphinx-autodoc-typehints",
105+
"sphinx-rtd-theme",
106+
]
107+
optional-dependencies.eval = [
108+
"gepa>=0.1",
109+
"google-cloud-aiplatform[evaluation]>=1.148",
110+
"jinja2>=3.1.4,<4", # For eval template rendering
116111
"pandas>=2.2.3",
117112
"rouge-score>=0.1.2",
118-
"tabulate>=0.9.0",
119-
# go/keep-sorted end
113+
"tabulate>=0.9",
120114
]
121-
122-
test = [
123-
# go/keep-sorted start
124-
"a2a-sdk>=0.3.0,<0.4.0",
125-
"anthropic>=0.43.0", # For anthropic model tests
126-
"crewai[tools];python_version>='3.11' and python_version<'3.12'", # For CrewaiTool tests; chromadb/pypika fail on 3.12+
127-
"google-cloud-firestore>=2.11.0, <3.0.0",
128-
"google-cloud-iamconnectorcredentials>=0.1.0, <0.2.0",
129-
"google-cloud-parametermanager>=0.4.0, <1.0.0",
130-
"kubernetes>=29.0.0", # For GkeCodeExecutor
115+
# Optional extensions
116+
optional-dependencies.extensions = [
117+
"anthropic>=0.43", # For anthropic model support
118+
"beautifulsoup4>=3.2.2", # For load_web_page tool.
119+
"crewai[tools]; python_version>='3.11' and python_version<'3.12'", # For CrewaiTool; chromadb/pypika fail on 3.12+
120+
"docker>=7", # For ContainerCodeExecutor
121+
"google-cloud-firestore>=2.11,<3", # For Firestore services
122+
"google-cloud-parametermanager>=0.4,<1",
123+
"k8s-agent-sandbox>=0.1.1.post3", # For GkeCodeExecutor sandbox mode
124+
"kubernetes>=29", # For GkeCodeExecutor
125+
"langgraph>=0.2.60,<0.4.8", # For LangGraphAgent
126+
"litellm>=1.75.5,<=1.82.6", # For LiteLlm class. Upper bound pinned: versions 1.82.7+ compromised in supply chain attack.
127+
"llama-index-embeddings-google-genai>=0.3", # For files retrieval using LlamaIndex.
128+
"llama-index-readers-file>=0.4", # For retrieval using LlamaIndex.
129+
"lxml>=5.3", # For load_web_page tool.
130+
"pypika>=0.50", # For crewai->chromadb dependency
131+
"toolbox-adk>=1,<2", # For tools.toolbox_toolset.ToolboxToolset
132+
]
133+
optional-dependencies.otel-gcp = [ "opentelemetry-instrumentation-google-genai>=0.6b0,<1" ]
134+
optional-dependencies.slack = [ "slack-bolt>=1.22" ]
135+
optional-dependencies.test = [
136+
"a2a-sdk>=0.3,<0.4",
137+
"anthropic>=0.43", # For anthropic model tests
138+
"crewai[tools]; python_version>='3.11' and python_version<'3.12'", # For CrewaiTool tests; chromadb/pypika fail on 3.12+
139+
"google-cloud-firestore>=2.11,<3",
140+
"google-cloud-iamconnectorcredentials>=0.1,<0.2",
141+
"google-cloud-parametermanager>=0.4,<1",
142+
"kubernetes>=29", # For GkeCodeExecutor
131143
"langchain-community>=0.3.17",
132-
"langgraph>=0.2.60, <0.4.8", # For LangGraphAgent
133-
"litellm>=1.75.5, <=1.82.6", # For LiteLLM tests. Upper bound pinned: versions 1.82.7+ compromised in supply chain attack.
134-
"llama-index-readers-file>=0.4.0", # For retrieval tests
135-
"openai>=1.100.2", # For LiteLLM
136-
"opentelemetry-instrumentation-google-genai>=0.3b0, <1.0.0",
137-
"pypika>=0.50.0", # For crewai->chromadb dependency
138-
"pytest-asyncio>=0.25.0",
139-
"pytest-mock>=3.14.0",
144+
"langgraph>=0.2.60,<0.4.8", # For LangGraphAgent
145+
"litellm>=1.75.5,<=1.82.6", # For LiteLLM tests. Upper bound pinned: versions 1.82.7+ compromised in supply chain attack.
146+
"llama-index-readers-file>=0.4", # For retrieval tests
147+
"openai>=1.100.2", # For LiteLLM
148+
"opentelemetry-instrumentation-google-genai>=0.3b0,<1",
149+
"pypika>=0.50", # For crewai->chromadb dependency
150+
"pytest>=9,<10",
151+
"pytest-asyncio>=0.25",
152+
"pytest-mock>=3.14",
140153
"pytest-xdist>=3.6.1",
141-
"pytest>=9.0.0,<10.0.0",
142154
"python-multipart>=0.0.9",
143155
"rouge-score>=0.1.2",
144-
"slack-bolt>=1.22.0",
145-
"tabulate>=0.9.0",
146-
# go/keep-sorted end
147-
]
148-
149-
docs = [
150-
"autodoc_pydantic",
151-
"furo",
152-
"myst-parser",
153-
"sphinx<9.0.0",
154-
"sphinx-autodoc-typehints",
155-
"sphinx-rtd-theme",
156+
"slack-bolt>=1.22",
157+
"tabulate>=0.9",
156158
]
159+
optional-dependencies.toolbox = [ "toolbox-adk>=1,<2" ]
160+
urls.changelog = "https://github.com/google/adk-python/blob/main/CHANGELOG.md"
161+
urls.documentation = "https://google.github.io/adk-docs/"
162+
urls.homepage = "https://google.github.io/adk-docs/"
163+
urls.repository = "https://github.com/google/adk-python"
164+
scripts.adk = "google.adk.cli:main"
157165

158-
# Optional extensions
159-
extensions = [
160-
"anthropic>=0.43.0", # For anthropic model support
161-
"beautifulsoup4>=3.2.2", # For load_web_page tool.
162-
"crewai[tools];python_version>='3.11' and python_version<'3.12'", # For CrewaiTool; chromadb/pypika fail on 3.12+
163-
"docker>=7.0.0", # For ContainerCodeExecutor
164-
"google-cloud-firestore>=2.11.0, <3.0.0", # For Firestore services
165-
"google-cloud-parametermanager>=0.4.0, <1.0.0",
166-
"kubernetes>=29.0.0", # For GkeCodeExecutor
167-
"k8s-agent-sandbox>=0.1.1.post3", # For GkeCodeExecutor sandbox mode
168-
"langgraph>=0.2.60, <0.4.8", # For LangGraphAgent
169-
"litellm>=1.75.5, <=1.82.6", # For LiteLlm class. Upper bound pinned: versions 1.82.7+ compromised in supply chain attack.
170-
"llama-index-readers-file>=0.4.0", # For retrieval using LlamaIndex.
171-
"llama-index-embeddings-google-genai>=0.3.0", # For files retrieval using LlamaIndex.
172-
"lxml>=5.3.0", # For load_web_page tool.
173-
"pypika>=0.50.0", # For crewai->chromadb dependency
174-
"toolbox-adk>=1.0.0, <2.0.0", # For tools.toolbox_toolset.ToolboxToolset
175-
]
166+
[tool.flit.sdist]
167+
include = [ 'src/**/*', 'README.md', 'pyproject.toml', 'LICENSE' ]
168+
exclude = [ 'src/**/*.sh' ]
176169

177-
otel-gcp = ["opentelemetry-instrumentation-google-genai>=0.6b0, <1.0.0"]
170+
[tool.flit.module]
171+
name = "google.adk"
172+
include = [ "py.typed" ]
178173

179-
toolbox = ["toolbox-adk>=1.0.0, <2.0.0"]
174+
[tool.isort]
175+
profile = "google"
176+
single_line_exclusions = [ ]
177+
line_length = 200 # Prevent line wrap flickering.
178+
known_third_party = [ "google.adk", "a2a" ]
180179

181-
slack = ["slack-bolt>=1.22.0"]
180+
[tool.pytest.ini_options]
181+
testpaths = [ "tests" ]
182+
asyncio_default_fixture_loop_scope = "function"
183+
asyncio_mode = "auto"
182184

183-
agent-identity = [
184-
"google-cloud-iamconnectorcredentials>=0.1.0, <0.2.0",
185-
]
185+
[tool.mypy]
186+
python_version = "3.10"
187+
exclude = [ "tests/", "contributing/samples/" ]
188+
plugins = [ "pydantic.mypy" ]
189+
strict = true
190+
disable_error_code = [ "import-not-found", "import-untyped", "unused-ignore" ]
191+
follow_imports = "skip"
186192

187193
[tool.pyink]
188194
# Format py files following Google style-guide
@@ -199,42 +205,3 @@ pyink-annotation-pragmas = [
199205
"pyright:",
200206
"pyre-",
201207
]
202-
203-
204-
[build-system]
205-
# Build system specify which backend is used to build/install the project (flit,
206-
# poetry, setuptools,...). All backends are supported by `pip install`
207-
requires = ["flit_core >=3.8,<4"]
208-
build-backend = "flit_core.buildapi"
209-
210-
211-
[tool.flit.sdist]
212-
include = ['src/**/*', 'README.md', 'pyproject.toml', 'LICENSE']
213-
exclude = ['src/**/*.sh']
214-
215-
216-
[tool.flit.module]
217-
name = "google.adk"
218-
include = ["py.typed"]
219-
220-
221-
[tool.isort]
222-
profile = "google"
223-
single_line_exclusions = []
224-
line_length = 200 # Prevent line wrap flickering.
225-
known_third_party = ["google.adk"]
226-
227-
228-
[tool.pytest.ini_options]
229-
testpaths = ["tests"]
230-
asyncio_default_fixture_loop_scope = "function"
231-
asyncio_mode = "auto"
232-
233-
234-
[tool.mypy]
235-
python_version = "3.10"
236-
exclude = ["tests/", "contributing/samples/"]
237-
plugins = ["pydantic.mypy"]
238-
strict = true
239-
disable_error_code = ["import-not-found", "import-untyped", "unused-ignore"]
240-
follow_imports = "skip"

0 commit comments

Comments
 (0)