Skip to content

Contributing

Contributions to pgraf are welcome! Here's how to get started.

Development Setup

  1. Fork the repository on GitHub
  2. Clone your fork locally:
git clone https://github.com/your-username/pgraf.git
cd pgraf
  1. Install development dependencies:
pip install -e ".[dev]"
  1. Set up pre-commit hooks:
pre-commit install
  1. Start the development database:
docker-compose up -d

Development Workflow

  1. Create a branch for your feature:
git checkout -b feature-name
  1. Make your changes
  2. Run tests:
pytest
  1. Run type checking:
mypy pgraf tests
  1. Run linting:
ruff check .
  1. Format code:
ruff format .
  1. Commit your changes
  2. Push your branch and create a pull request

Code Style Guidelines

  • Follow PEP-8 with 79 character line length (enforced by ruff)
  • Use single quotes for strings, double quotes for docstrings
  • Write Google-style docstrings
  • Include type annotations for all functions and methods
  • Run formatting with ruff before committing

Testing

  • Write unit tests for all new functionality
  • Ensure all tests pass before submitting a pull request
  • Maintain test coverage above 90%