
-- 5eabc6c1fe339e87637b9ed6d0516a3edcbcb060 by kavinkumarbaskar <kavinkumarbaskar@gmail.com>: fix readme pip install -- bb21018aea7a4b8d8a60e6ef42b084dae51d7845 by kavinkumarbaskar <kavinkumarbaskar@gmail.com>: fix: added build and local testing command -- aa1f2305b098b79480eab9ab37b744d0273a5fcf by kavinkumarbaskar <kavinkumarbaskar@gmail.com>: fix: added example -- 69b649d81e6757d6305c481e3415ec8f017a75ac by kavinkumarbaskar <kavinkumarbaskar@gmail.com>: fix: updated the windows command -- bd5202308bf08b9b44099c4cd016af23f2e2350e by kavinkumarbaskar <kavinkumarbaskar@gmail.com>: fix: removed redundant code COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/529 from kavinkumar807:fix-readme-pip-install a49d82d49a0cecb4cee399620c62ae10c1f3370a PiperOrigin-RevId: 756122021
5.7 KiB
How to contribute
We'd love to accept your patches and contributions to this project.
Table of Contents
Before you begin
Sign our Contributor License Agreement
Contributions to this project must be accompanied by a Contributor License Agreement (CLA). You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project.
If you or your current employer have already signed the Google CLA (even if it was for a different project), you probably don't need to do it again.
Visit https://cla.developers.google.com/ to see your current agreements or to sign a new one.
Review our community guidelines
This project follows Google's Open Source Community Guidelines.
Contribution workflow
Finding Issues to Work On
- Browse issues labeled
good first issue
(newcomer-friendly) orhelp wanted
(general contributions). - For other issues, please kindly ask before contributing to avoid duplication.
Requirement for PRs
- All PRs, other than small documentation or typo fixes, should have a Issue assoicated. If not, please create one.
- Small, focused PRs. Keep changes minimal—one concern per PR.
- For bug fixes or features, please provide logs or screenshot after the fix is applied to help reviewers better understand the fix.
- Please include a
testing plan
section in your PR to talk about how you will test. This will save time for PR review. SeeTesting Requirements
section for more details.
Large or Complex Changes
For substantial features or architectural revisions:
- Open an Issue First: Outline your proposal, including design considerations and impact.
- Gather Feedback: Discuss with maintainers and the community to ensure alignment and avoid duplicate work
Testing Requirements
To maintain code quality and prevent regressions, all code changes must include comprehensive tests and verifiable end-to-end (E2E) evidence.
Unit Tests
Please add or update unit tests for your change. Please include a summary of passed pytest
results.
Requirements for unit tests:
- Coverage: Cover new features, edge cases, error conditions, and typical use cases.
- Location: Add or update tests under
tests/unittests/
, following existing naming conventions (e.g.,test_<module>_<feature>.py
). - Framework: Use
pytest
. Tests should be:- Fast and isolated.
- Written clearly with descriptive names.
- Free of external dependencies (use mocks or fixtures as needed).
- Quality: Aim for high readability and maintainability; include docstrings or comments for complex scenarios.
Manual End-to-End (E2E) Tests
Manual E2E tests ensure integrated flows work as intended. Your tests should cover all scenarios. Sometimes, it's also good to ensure relevant functionality is not impacted.
Depending on your change:
-
ADK Web:
- Use the
adk web
to verify functionality. - Capture and attach relevant screenshots demonstrating the UI/UX changes or outputs.
- Label screenshots clearly in your PR description.
- Use the
-
Runner:
- Provide the testing setup. For example, the agent definition, and the runner setup.
- Execute the
runner
tool to reproduce workflows. - Include the command used and console output showing test results.
- Highlight sections of the log that directly relate to your change.
Documentation
For any changes that impact user-facing documentation (guides, API reference, tutorials), please open a PR in the adk-docs repository to update relevant part before or alongside your code PR.
Development Setup
-
Clone the repository:
git clone git@github.com:google/adk-python.git cd adk-python
-
Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate
windows
source .\.venv\Scripts\activate
pip install uv
-
Install dependencies:
uv sync --all-extras
-
Run unit tests:
uv run pytest ./tests/unittests
-
Run pyink to format codebase:
uv run pyink --config pyproject.toml ./src
-
Build the package
uv build
-
Local Testing Have a simple testing folder setup as mentioned in the quickstart then install the local package with changes after building it using the below command to test the changes.
uv pip install <YOUR_WHL_FILE_PATH> [eg]: uv pip install <ADK_PROJECT_PATH>/dist/google_adk-0.4.0-py3-none-any.whl
Code reviews
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.