This guide contains detailed information for developers contributing to PyComet.
- Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh
- Clone and install:
git clone https://github.com/jaydoubleu/pycomet.git
cd pycomet
uv sync
- Install development dependencies:
uv add --dev black ruff pytest pytest-cov mypy types-PyYAML pre-commit
- Set up test environment:
# Copy example test environment file
cp .env.example .env.test
# Edit .env.test with your test API keys
PyComet includes a comprehensive test suite that verifies functionality across multiple AI providers.
Basic test execution:
# Run all tests
uv run pytest tests/
# Run tests for specific model
uv run pytest tests/ -k "gemini"
# Run tests with detailed LLM output
uv run pytest tests/ --show-llm-output
# Run tests for specific model with LLM output
uv run pytest tests/ -k "gemini" --show-llm-output
For detailed information about testing options and configurations, see tests/README.md.
# Format code
uv run black .
# Run linter
uv run ruff check .
# Type checking
uv run mypy .
Before submitting a PR, ensure:
- All tests pass
- Code is formatted with black
- No linting errors from ruff
- Type hints are valid (mypy)
- Test coverage is maintained
- LLM tests pass with
--show-llm-output
To automate these checks, we use pre-commit hooks:
- Install pre-commit:
uv add --dev pre-commit
- Install the pre-commit hooks:
uv run pre-commit install
- Run the hooks manually (if needed):
uv run pre-commit run --all-files
- Fork the repository
- Create your feature branch
- Make your changes
- Run the tests and quality checks
- Submit a pull request
- Include tests for new functionality
- Update documentation as needed
- Follow the existing code style
- Keep changes focused and atomic
- Add meaningful commit messages