Thank you for your interest in contributing to A2A! This document provides guidelines and information for contributors.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Code Style
- Testing
- Pull Request Process
- Reporting Issues
By participating in this project, you agree to abide by our Code of Conduct. Please read it before contributing.
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/a2a.git cd a2a -
Add the upstream remote:
git remote add upstream https://github.com/H2OKing89/a2a.git
- Python 3.11 or higher
mediainfosystem package- Git
-
Create a virtual environment:
python -m venv .venv source .venv/bin/activate # Linux/macOS
-
Install dependencies:
make install-dev
-
Install pre-commit hooks:
make setup-hooks
-
Verify your setup:
make test
Use descriptive branch names:
feature/add-new-command- New featuresfix/resolve-cache-issue- Bug fixesdocs/update-readme- Documentationrefactor/simplify-client- Code refactoringtest/add-quality-tests- Test additions
Follow Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or modifying testschore: Maintenance tasks
Examples:
feat(quality): add support for FLAC format analysis
fix(audible): handle rate limiting gracefully
docs(readme): add installation instructions for Windows
test(abs): add integration tests for library endpoints
- Line length: 120 characters
- Formatting: Black
- Import sorting: isort
- Docstrings: Google style
# Format all code
make format
# Check formatting without changes
black --check src/ tests/ cli.py
isort --check-only src/ tests/ cli.py# Run all linters
make lintThis runs:
flake8- Style guide enforcementmypy- Type checkingbandit- Security analysis
When creating Pydantic models for API responses:
from pydantic import BaseModel, Field
class MyModel(BaseModel):
"""Model description."""
my_field: str = Field(alias="myField")
optional_field: str | None = None
model_config = {"extra": "ignore"}Type hints are encouraged but not strictly required:
def analyze_quality(items: list[LibraryItem]) -> QualityReport:
"""Analyze quality of library items."""
...# Run all tests
make test
# Run with coverage
make coverage
# Run specific tests
pytest tests/test_quality_analyzer.py
pytest -k "test_cache"
# Run with verbose output
pytest -v- Place tests in the
tests/directory - Name test files
test_*.py - Name test functions
test_* - Use pytest fixtures from
conftest.py
Example test:
import pytest
from src.quality.analyzer import QualityAnalyzer
class TestQualityAnalyzer:
"""Tests for QualityAnalyzer."""
def test_analyze_high_bitrate(self, mock_abs_client):
"""Test that high bitrate items are marked excellent."""
analyzer = QualityAnalyzer(mock_abs_client)
result = analyzer.analyze(item_with_high_bitrate)
assert result.tier == "EXCELLENT"Aim for meaningful test coverage:
- Cover happy paths and error cases
- Test edge cases
- Mock external dependencies (APIs, file system)
-
Update your branch:
git fetch upstream git rebase upstream/main
-
Run all checks:
make pre-commit make test -
Update documentation if needed
- Push your changes to your fork
- Open a Pull Request against
main - Fill out the PR template completely
- Link any related issues
- All CI checks pass
- Tests added for new functionality
- Documentation updated if needed
- Code follows project style guide
- Commits follow conventional commits format
- CHANGELOG.md updated with your changes
- Version bumped if needed (see Versioning below)
- A maintainer will review your PR
- Address any requested changes
- Once approved, the PR will be merged
A2A follows Semantic Versioning: MAJOR.MINOR.PATCH
PATCH (0.1.0 β 0.1.1): Backward-compatible bug fixes only
- Fixing a crash
- Correcting error messages
- Performance improvements (no API changes)
MINOR (0.1.0 β 0.2.0): New features that are backward-compatible
- Adding new CLI flags (e.g.,
--fast) - Adding new API methods
- Adding new models/classes
- Bug fixes + new features together
MAJOR (0.1.0 β 1.0.0): Breaking changes
- Removing CLI commands or flags
- Changing API signatures
- Changing config file structure
- Removing or renaming public classes/functions
# Using the version utility
python tools/version.py patch # 0.1.0 β 0.1.1
python tools/version.py minor # 0.1.0 β 0.2.0
python tools/version.py major # 0.1.0 β 1.0.0
# Or using make
make bump-patch
make bump-minor
make bump-majorVersion is stored in src/__init__.py:
__version__ = "0.2.0"When your PR adds features or fixes bugs, update CHANGELOG.md:
- Add an entry under the
[Unreleased]section if version hasn't been bumped yet - Or create a new version section if bumping version (e.g.,
## [0.2.0] - 2025-12-28) - Organize changes by category:
### Added- New features### Fixed- Bug fixes### Changed- Changes to existing functionality### Deprecated- Soon-to-be removed features### Removed- Removed features### Security- Security fixes### Performance- Performance improvements
Example:
## [0.2.0] - 2025-12-28
### Added
- Async batch enrichment service for Audible quality discovery
- New CLI flag `--fast` for `quality upgrades` to skip license requests
### Fixed
- Missing Audible pricing in `quality upgrades`
- Progress bar stuck at 0% during async batch enrichment
### Performance
- Concurrent async quality discovery with configurable limitsWhen reporting bugs, please include:
- Environment: OS, Python version
- Steps to reproduce
- Expected behavior
- Actual behavior
- Error messages/logs
- Configuration (sanitized)
Use the bug report template.
When requesting features, please include:
- Use case: Why do you need this?
- Proposed solution: How should it work?
- Alternatives considered: Other approaches you've thought of
Use the feature request template.
- Check the documentation
- Search existing issues
- Open a discussion
Thank you for contributing! π§