Contributing to Pydapter¶
Thank you for your interest in contributing to Pydapter! This document provides guidelines and instructions for contributing to the project.
Development Environment Setup¶
- Fork the repository on GitHub
- Clone your fork locally:
- Set up a development environment:
- Install pre-commit hooks:
Development Workflow¶
- Create a new branch for your feature or bugfix:
-
Make your changes, following the project's coding standards
-
Run the CI script locally to ensure all tests pass:
- Commit your changes using conventional commit messages:
- Push your branch to your fork:
- Open a pull request on GitHub
Continuous Integration¶
The project uses a comprehensive CI system that runs:
- Linting checks (using ruff)
- Code formatting checks (using ruff format)
- Type checking (using mypy)
- Unit tests (using pytest)
- Integration tests (using pytest)
- Coverage reporting
- Documentation validation (using markdownlint and markdown-link-check)
You can run the CI script locally with various options:
# Run all checks
python scripts/ci.py
# Skip integration tests (which require Docker)
python scripts/ci.py --skip-integration
# Run only documentation validation
python scripts/ci.py --only docs
# Run only linting and formatting checks
python scripts/ci.py --skip-unit --skip-integration --skip-coverage --skip-docs
# Run tests in parallel
python scripts/ci.py --parallel 4
For more information, see the CI documentation.
Code Style¶
This project follows these coding standards:
- Code formatting with ruff format
- Linting with ruff
- Type annotations for all functions and classes
- Comprehensive docstrings in Google style
- Test coverage for all new features
Testing¶
All new features and bug fixes should include tests. The project uses pytest for testing:
# Run all tests
uv run pytest
# Run specific tests
uv run pytest tests/test_specific_file.py
# Run with coverage
uv run pytest --cov=pydapter
Documentation¶
Documentation is written in Markdown and built with MkDocs using a hybrid approach that combines auto-generated API references with enhanced manual content.
Documentation Standards¶
All documentation must follow these standards:
- Markdown Quality: All markdown files must pass
markdownlint
validation - Link Integrity: All internal and external links must be valid
- API Documentation: Use the hybrid approach with enhanced manual content
- Code Examples: Include working code examples with proper syntax highlighting
- Cross-References: Link related concepts and maintain navigation consistency
Validation Tools¶
The project uses automated validation tools:
- markdownlint: Ensures consistent markdown formatting
- markdown-link-check: Validates all links in documentation
- Pre-commit hooks: Automatic validation before commits
Writing Documentation¶
When contributing documentation:
- API Reference: Follow the pattern established in
docs/api/protocols.md
anddocs/api/core.md
- Manual Enhancement: Add examples, best practices, and cross-references beyond basic API extraction
- User Personas: Consider different user needs (new users, API users, contributors)
- Code Examples: Provide complete, runnable examples
- Navigation: Ensure proper cross-linking between related sections
Documentation Workflow¶
# Preview documentation locally
uv run mkdocs serve
# Validate documentation
python scripts/ci.py --only docs
# Check specific files
markdownlint docs/**/*.md
markdown-link-check docs/api/core.md --config .markdownlinkcheck.json
# Fix common issues automatically (when possible)
markdownlint --fix docs/**/*.md
Documentation Structure¶
docs/api/
: API reference documentation (hybrid approach)docs/tutorials/
: Step-by-step guidesdocs/
: General guides and concepts- Examples should be complete and testable
- Cross-references should use relative links
Then open http://127.0.0.1:8000/ in your browser to preview changes.
Pull Request Process¶
- Ensure your code passes all CI checks
- Update documentation if necessary
- Add tests for new features
- Make sure your PR description clearly describes the changes and their purpose
- Wait for review and address any feedback
License¶
By contributing to Pydapter, you agree that your contributions will be licensed under the project's MIT License.