-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathpyproject.toml
More file actions
137 lines (123 loc) · 4.5 KB
/
Copy pathpyproject.toml
File metadata and controls
137 lines (123 loc) · 4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
[project]
name = "adk-samples-tools"
version = "0.1.0"
requires-python = ">=3.11"
authors = [
{ name = "Shahin Saadati", email = "shahins@google.com" },
]
dependencies = [
"pyyaml",
"jsonschema",
]
[project.scripts]
validate = "validate:main"
[dependency-groups]
# Test-only dependencies for the repo tooling (tools/) and skill scripts
# (.agents/skills/*/scripts/). Install with `uv sync --dev`.
#
# tomlkit, ruamel.yaml and packaging are imported directly by
# .agents/skills/align-recipe-pyproject/scripts/align_pyproject.py, which
# pytest imports via that skill's tests. Without them, collection of the
# whole suite fails. They live here rather than in [project.dependencies]
# because nothing under tools/ needs them at runtime.
#
# packaging is also imported by .github/scripts/check_recipe_pyproject.py,
# but that gate injects its own deps via `uv run --with` and does not read
# this group -- so it is declared here for the test run, not for that gate.
dev = [
"pytest>=8",
"tomlkit>=0.13",
"ruamel.yaml>=0.18",
"packaging>=24",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.uv]
# Pin the minimum uv version so astral-sh/setup-uv reads it from here
# instead of falling back to the GitHub API (which fails during outages).
required-version = ">=0.5"
# Use public PyPI as the default index for this project.
[[tool.uv.index]]
url = "https://pypi.org/simple/"
default = true
[tool.hatch.build.targets.wheel]
packages = ["tools"]
[tool.hatch.build.targets.wheel.sources]
"tools" = ""
[tool.ruff]
line-length = 80
target-version = "py310"
# Resolve first-party imports per recipe, so a package not named `app` is
# still first-party to its own recipe.
#
# All three recipe roots sit two levels deep, but the middle segment differs:
# it is a LANGUAGE under core/ and contrib/, and a VERTICAL under skills/
# (skills/<vertical>/<solution>). Omitting skills/*/* made ruff treat a
# vertical skill's own sibling modules as third-party and sort its imports
# into the wrong block.
src = [".", "core/*/*", "contrib/*/*", "skills/*/*"]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"C", # flake8-comprehension
"PL", # Pylint rules
"B", # flake8-bugbear
"UP", # pyupgrade
"RUF" # ruff specific rules
]
ignore = [
"E501", # Long LLM prompts and log messages need long strings
"PLR0913", # Agents and tools legitimately have many parameters
"PLR2004", # HTTP status codes (200, 422) are universally understood
"PLC0415", # Deferred imports in tests are valid for ADK recipe side effects
# Function-size family, same rationale as PLR0913; already tripped by
# merged recipes.
"PLR0917", # too-many-positional-arguments
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0915", # too-many-statements
"C901", # complex-structure
"PLW0603", # Module-level singletons and caches
]
[tool.ruff.lint.per-file-ignores]
# Global rule: ADK agents use __init__.py to expose their logic
"**/__init__.py" = ["F401"]
[tool.ruff.lint.isort]
# Every Python recipe's package is named `app` by convention, so isort should
# treat it as first-party across the whole repo. Hoisted here so recipe
# pyproject.toml files no longer need their own [tool.ruff*] block (see the
# A1 check in .github/workflows/python-validate-recipe.yml).
known-first-party = ["app"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.pytest.ini_options]
# importlib mode avoids sys.path pollution and lets same-named test files
# coexist across skills without collection collisions.
addopts = "--import-mode=importlib"
# Only the repo tooling and skill scripts are tested here. Recipe tests under
# core/ and contrib/ have their own per-recipe suites (see python-tests.yml).
# .github/scripts has no tests yet; it is listed so that any added later are
# collected without a config change. Those scripts gate real PRs (e.g.
# check_env_vars.py and check_recipe_pyproject.py run in
# python-validate-recipe.yml) and are currently uncovered.
testpaths = [
"tools/tests",
".agents/skills",
".github/scripts",
]
# Never descend into skill template payloads or virtualenvs. The scaffold
# skill ships template test files under resources/templates/tests/ that contain
# unresolved <PLACEHOLDER> tokens and must NOT be collected as real tests.
norecursedirs = [
"resources",
".venv",
".ruff_cache",
"*.egg-info",
]
[tool.codespell]
ignore-words-list = "rouge"
skip = "./locust_env/*,uv.lock,.venv,./frontend,**/*.ipynb"