Thank you for your interest in contributing to Python Chrome DevTools Protocol (PyCDP)! This document provides guidelines for contributing to the project.
- Python 3.7 or higher
- Poetry for dependency management
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/python-chrome-devtools-protocol.git cd python-chrome-devtools-protocol - Install dependencies:
poetry install
This project automatically generates Python wrappers from the Chrome DevTools Protocol specification. Most code in the cdp/ directory (except connection.py and util.py) is auto-generated.
To regenerate the protocol wrappers:
poetry run make generateRun the test suite:
poetry run make test-cdp
poetry run make test-generateOr run all checks:
poetry run makeWe use mypy for static type checking:
poetry run make mypy-cdp
poetry run make mypy-generateTo build the documentation:
poetry run make docs- Follow PEP 8 style guidelines
- Use type hints for all function signatures
- Keep code clear and well-documented
- Use clear and descriptive commit messages
- Reference issue numbers when applicable
- Keep commits focused on a single change
- Create a new branch for your changes:
git checkout -b feature/your-feature-name
- Make your changes and commit them
- Push to your fork and submit a pull request
- Ensure all tests pass and type checking succeeds
- Provide a clear description of your changes
- Bug fixes: Fix issues in the connection module or utility functions
- Documentation: Improve examples, tutorials, or API documentation
- Tests: Add test coverage for existing functionality
- Examples: Add new usage examples in the
examples/directory
If you need to modify code generation:
- Edit files in the
generator/directory - Run the generator and verify the output
- Ensure all tests still pass
- Add tests for your generator changes
The protocol definitions are automatically fetched from the Chrome DevTools Protocol repository. If you need to update to a newer protocol version, please open an issue first to discuss the change.
When reporting bugs, please include:
- Python version
- PyCDP version
- Steps to reproduce
- Expected vs. actual behavior
- Error messages or stack traces
For feature requests:
- Clearly describe the feature
- Explain the use case
- Consider if it fits the project's scope
Please be respectful and constructive in all interactions. We are committed to providing a welcoming and inclusive environment for all contributors.
If you have questions about contributing, please:
- Check existing issues and pull requests
- Open a new issue with your question
- Tag it appropriately for visibility
By contributing to PyCDP, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to PyCDP!