Contributing to Pyvider¶
Thank you for your interest in contributing to Pyvider! This guide will help you get started with contributing code, documentation, or bug reports.
🤖 AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
📋 Table of Contents¶
- Code of Conduct
- Getting Started
- Development Workflow
- Testing Requirements
- Documentation Updates
- Pull Request Process
- Code Style Guidelines
- Reporting Bugs
- Requesting Features
Code of Conduct¶
By participating in this project, you agree to abide by our Code of Conduct. Please read it before contributing.
Getting Started¶
First Time Contributors¶
Welcome! Here's how to get started:
- Look for "good first issue" labels in the issue tracker
- Read the architecture docs to understand how Pyvider works:
- Architecture Overview
- Component Model
- Ask questions in GitHub Discussions
Prerequisites¶
- Python 3.11 or higher
- Git
- uv
- Basic understanding of Terraform concepts
- Familiarity with async/await in Python
Development Workflow¶
1. Fork and Clone¶
| Bash | |
|---|---|
2. Set Up Development Environment¶
3. Create a Branch¶
| Bash | |
|---|---|
4. Make Changes¶
See CLAUDE.md in the repository root for detailed development commands:
| Bash | |
|---|---|
5. Commit Your Changes¶
| Bash | |
|---|---|
Commit Message Guidelines: - Use present tense ("Add feature" not "Added feature") - Use imperative mood ("Move cursor to..." not "Moves cursor to...") - First line should be 50 characters or less - Reference issues and PRs liberally
Testing Requirements¶
Before Submitting a PR¶
Your PR must include tests and pass all checks:
Writing Tests¶
- Unit tests for individual functions and classes
- Integration tests for protocol handlers
- Async tests using
pytest.mark.asyncio - Property-based tests using Hypothesis where appropriate
Example test structure:
See the Testing Providers Guide for more details.
Documentation Updates¶
When to Update Documentation¶
Update documentation when you:
- Add new public APIs or features
- Change existing behavior
- Fix bugs that were unclear in docs
- Add new examples or use cases
Documentation Locations¶
- API docs: Docstrings in source code (Google style)
- Guides:
docs/guides/*.md - API reference:
docs/api/*.md - Examples: Link to pyvider-components
API Documentation Approach¶
Pyvider uses a hybrid approach for API reference documentation:
Manual Documentation (api/cli.md, api/common.md, api/hub.md, etc.):
- Curated examples and explanations
- Context and usage patterns
- Best practices and common pitfalls
- Cross-references to guides
Auto-Generated Sections (via mkdocstrings): - Rendered directly from Python docstrings - Always up-to-date with code - Complete parameter listings - Type signatures
Why both? - Manual docs provide context, examples, and guidance - Auto-generated docs ensure technical accuracy - Together they serve different reader needs
When contributing: - Update docstrings for code changes (will auto-generate) - Update manual pages for new features or changed workflows - Keep both in sync
Documentation Style¶
- Use clear, concise language
- Include code examples
- Add cross-references to related docs
- Test all code examples
- Run the documentation build locally:
| Bash | |
|---|---|
Pull Request Process¶
Before Submitting¶
- ✅ All tests pass (
uv run pytest) - ✅ Linters pass (
uv run ruff check) - ✅ Type checking passes (
uv run mypy src/pyvider) - ✅ Code is formatted (
uv run ruff format) - ✅ Documentation is updated
- ✅ Commit messages are clear
- ✅ Branch is up to date with main
Submitting Your PR¶
-
Push your branch to your fork:
Bash -
Open a Pull Request on GitHub
-
Fill out the PR template with:
- Clear description of changes
- Link to related issue(s)
- Summary of testing done
- Any breaking changes
-
Screenshots (if UI changes)
-
Request review from maintainers
PR Review Process¶
- Maintainers will review your PR within a few days
- Address feedback by pushing new commits
- Once approved, maintainers will merge your PR
- Your contribution will be in the next release!
PR Guidelines¶
- Keep PRs focused - One feature or bug fix per PR
- Small PRs are better - Easier to review and merge
- Add tests - All new code must have tests
- Update docs - User-facing changes need documentation
- Follow conventions - Match existing code style
- Be responsive - Address review feedback promptly
Code Style Guidelines¶
Python Code Style¶
- Follow PEP 8 with exceptions noted in
pyproject.toml - Line length: 100 characters (enforced by ruff)
- Type hints: Required for all function signatures
- Docstrings: Google style for all public APIs
- Imports: Organized by ruff (stdlib, third-party, local)
Type Hints¶
| Python | |
|---|---|
Docstrings¶
Use Google-style docstrings:
Async/Await¶
- Use
async deffor I/O operations - Always
awaitasync calls - Use
asyncio.gather()for parallel operations - Avoid blocking calls in async functions
Reporting Bugs¶
Found a bug? Please report it!
Before Reporting¶
- Search existing issues - Your bug may already be reported
- Try the latest version - Bug might be fixed in main
- Gather information - Version, OS, error messages
Bug Report Template¶
Create an issue with:
Requesting Features¶
Have an idea for a new feature?
- Search existing issues - Someone may have requested it
- Open a discussion - Discuss the idea before implementing
- Create a feature request - With clear use case and examples
Getting Help¶
Need help contributing?
- Documentation: Read our guides
- Discussions: Ask in GitHub Discussions
- Issues: Search existing issues
- Examples: Check pyvider-components
Development Reference¶
Quick reference for common tasks:
See CLAUDE.md for the complete development command reference.
Recognition¶
Contributors are recognized in: - Release notes - GitHub contributors page - Special thanks in documentation
Thank you for contributing to Pyvider! 🎉