Contributing
Thank you for your interest in contributing to Python A2A! This guide will help you get started.
Code of Conduct
Everyone participating in the Python A2A project is expected to treat other people with respect and follow these guidelines:
Use welcoming and inclusive language
Be respectful of different viewpoints and experiences
Gracefully accept constructive criticism
Focus on what is best for the community
Show empathy towards other community members
Development Setup
Here’s how to set up Python A2A for local development:
Fork the python-a2a repo on GitHub.
Clone your fork locally:
git clone git@github.com:YOUR_USERNAME/python-a2a.git cd python-a2a
Create a virtual environment and install the development dependencies:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -e ".[dev]"
Create a branch for your changes:
git checkout -b name-of-your-bugfix-or-feature
Make your changes and run the tests to ensure everything works:
pytest
Code Style
Python A2A follows these code style guidelines:
You can automatically format your code by running:
black python_a2a
isort python_a2a
And check for issues with:
flake8 python_a2a
Type Hints
Python A2A uses type hints to improve code quality and IDE support. Please add type hints to your code following these guidelines:
Add type hints to all function arguments and return values
Use
Optional[T]for arguments that could beNoneUse
Union[T1, T2]for arguments that could be multiple typesUse
Anysparingly, and only when necessary
Documentation
Documentation is written in reStructuredText (.rst) and built with Sphinx. To build the documentation locally:
Install the documentation dependencies:
pip install -r docs/requirements.txt
Build the documentation:
cd docs make html
View the documentation in your browser:
# On macOS open _build/html/index.html # On Linux xdg-open _build/html/index.html # On Windows start _build/html/index.html
When writing documentation:
Use clear, concise language
Include examples where appropriate
Update documentation when you change code
Add docstrings to all public functions, classes, and methods
Pull Request Process
Update the documentation with details of changes to the interface, including new environment variables, exposed ports, useful file locations, and container parameters.
Make sure all tests pass and the code follows the project’s style guidelines.
Update the README.md or other relevant documentation if needed.
The versioning scheme we use is SemVer.
Submit a pull request to the main repository. In your pull request description, explain the changes and reference any relevant issues.
Your pull request will be reviewed by the maintainers. You may be asked to make changes before it’s accepted.
Once your pull request is approved, it will be merged into the main branch.
Adding New Features
If you want to add a new feature to Python A2A, please follow these guidelines:
First, open an issue to discuss the feature before implementing it. This helps ensure that your work won’t be rejected.
Keep new features modular and composable with existing functionality.
Add appropriate tests and documentation for your feature.
Ensure backward compatibility whenever possible.
Reporting Bugs
When reporting bugs, please include:
The version of Python A2A you’re using
Your operating system and Python version
Detailed steps to reproduce the bug
What you expected to happen
What actually happened
Any error messages or stack traces
License
By contributing to Python A2A, you agree that your contributions will be licensed under the project’s MIT License.