AGENT SKILL

ADK Python 开发环境搭建

adk-setup

在开源 adk-python 仓库的 git 克隆中搭建本地 ADK Python 开发环境:uv 虚拟环境、全部依赖 extras、pre-commit 钩子以及首次单元测试运行。仅在明确要求时运行,绝不自行触发。当被要求搭建、初始化或修复开发检出环境,安装项目依赖,修复缺失或损坏的 .venv,或为提交 pull request 准备机器时使用此技能。不要用于调试正在运行的智能体(使用 adk-debug),不要用于处理提交与 pull request 的流程(使用 adk-git),也不要用于对已搭建好的检出环境重新运行格式化工具(pre-commit run --all-files)。

使用场景开发参考
License 许可
Apache-2.0
所属仓库
google/adk-python
最近更新
2026-11-14
Stars
★ 2.2w
Forks
4.4k

01 前言 Front Matter

name
adk-setup
description
Sets up a local ADK Python development environment in a git clone of the open-source adk-python repository: a uv virtual environment, all dependency extras, pre-commit hooks, and a first unit-test run. Runs only when explicitly requested, never on its own. Use when asked to set up, bootstrap, or repair a development checkout, install project dependencies, fix a missing or broken .venv, or prepare a machine for contributing a pull request. Don't use for debugging a running agent (use adk-debug), for commit and pull-request mechanics (use adk-git), or for re-running formatters on a checkout that is already set up (pre-commit run --all-files).
disable-model-invocation
true

03 SKILL.md 正文

ADK Python Development Setup

Set up a working adk-python checkout: a uv-managed virtual environment with every dependency extra, pre-commit hooks, and a green unit-test run.

Prerequisites

  1. Python. ADK supports 3.11 through 3.15 (requires-python = ">=3.11" in pyproject.toml). These steps use 3.11, the version the repo's own tooling defaults to.

    python3 --version
    
  2. uv. Dependencies are declared in pyproject.toml. The uv sync step below creates a local uv.lock, which this repository ignores. Run that step before tox, whose lock runner requires the file.

    uv --version
    

    Install it if missing:

    curl -LsSf https://astral.sh/uv/install.sh | sh
    

Setup

Run these from the repository root.

  1. Create and activate the virtual environment:

    uv venv --python "python3.11" ".venv"
    source .venv/bin/activate
    
  2. Install every dependency extra:

    uv sync --all-extras
    

    --all-extras is what pulls in the test and dev extras. Syncing only the default dependencies leaves pytest and the linters uninstalled.

  3. Install pre-commit and tox as standalone tools:

    uv tool install pre-commit
    uv tool install tox --with tox-uv
    

    Both are also in the dev extra; installing them as uv tools puts them on PATH so the git hook and multi-version test runs work without an activated venv.

  4. Install addlicense (optional, requires Go):

    go install github.com/google/addlicense@latest
    

    Without it the pre-commit hook prints Warning: addlicense not installed, skipping and passes, so a missing Go toolchain does not block setup — CI catches missing license headers instead.

  5. Install the git hooks:

    pre-commit install
    

    On each commit the hooks auto-format with isort, pyink, and mdformat, then run ruff, addlicense, codespell, and the repo's own compliance checks.

  6. Verify the environment:

    pytest tests/unittests -n auto
    

    A green run here is the success criterion for setup. -n auto needs pytest-xdist, which arrives with the test extra in step 2.

Key commands

Task Command
Run unit tests pytest tests/unittests
Run unit tests in parallel pytest tests/unittests -n auto
Run one test file pytest tests/unittests/agents/test_base_agent.py
Run tests on every supported Python tox (uv downloads any missing interpreters)
Format and lint everything pre-commit run --all-files
Launch the web UI adk web {agents_dir}
Run an agent from the CLI adk run {agent_dir}
Build the wheel uv build

04 同仓库更多 Skills

google
google/adk-python

BigQuery 图查询分析

bigquery-graph

针对属性图使用图查询语言(GQL)或 SQL/PGQ 进行查询的技能。包括路径查找、多跳遍历、拓扑连接、最短路径、节点可达性、边连通性和语义图查询。

数据分析师数据分析与报告
★ 2.2w
google
google/adk-python

BigQuery AI 与机器学习分析

bigquery-ai-ml

利用 BigQuery 内置的机器学习与生成式 AI 能力进行高级数据分析。当您需要编写 SQL 查询以执行时间序列预测、数值预测、异常值或异常检测、寻找关键驱动因素、语义搜索或向量搜索、文本分类、相似度计算、内容摘要、语言翻译、模型评估、按语义条件筛选、衡量干预措施的因果效应、计算列之间的相关性、检测变化点或结构性突变、提取趋势或季节性成分,或利用 BigQuery 中的生成式 AI 能力时使用。不适用于常规的 BigQuery 数据集、表或作业管理请求。

数据分析师数据分析与报告
★ 2.2w
google
google/adk-python

代码审查与定制反馈

code-review-skill

审查代码,并根据会话状态中开发者的个人画像提供量身定制的反馈。

软件开发工程师测试与质量保障
★ 2.2w
google
google/adk-python

天气信息查询

weather-skill

基于参考数据提供天气信息的技能。

通用知识岗位天气信息查询
★ 2.2w
google
google/adk-python

天气信息查询

weather-skill

基于参考数据和脚本提供天气信息的技能。

通用知识岗位天气信息查询
★ 2.2w
google
google/adk-python

天气信息查询

weather-skill

一种基于参考数据提供天气信息的技能。

知识工作者网页搜索与信息研究
★ 2.2w