Contributing to Instructor Classify¶
We welcome contributions to Instructor Classify! This document provides guidelines and instructions for contributing.
Development Setup¶
-
Fork the repository and clone your fork:
-
Create a virtual environment (optional but recommended):
-
Install in development mode with dev dependencies:
-
Install pre-commit hooks:
Development Workflow¶
-
Create a new branch for your feature or bugfix:
-
Make your changes, following the code style guidelines
-
Run tests to ensure your changes don't break existing functionality:
-
Update documentation if needed:
-
Commit your changes with a descriptive commit message:
-
Push your branch to your fork:
-
Create a pull request on GitHub
Commit Message Guidelines¶
We use conventional commits for our commit messages:
feat:
for new featuresfix:
for bug fixesdocs:
for documentation changesstyle:
for formatting changesrefactor:
for code restructuring without changing functionalitytest:
for adding or modifying testschore:
for routine tasks, dependency updates, etc.
Example: feat: Add support for Claude models
Testing¶
All new features and bug fixes should include tests. We use pytest for testing:
# Run all tests
pytest
# Run specific tests
pytest tests/test_classifier.py
# Run tests with coverage
pytest --cov=instructor_classify
Documentation¶
Documentation is written in Markdown and built with MkDocs:
- All new features should be documented
- Update existing documentation as needed
- Include code examples to demonstrate usage
- Run
mkdocs serve
to preview documentation locally before submitting
Pull Request Process¶
- Ensure your code follows the style guidelines
- Ensure all tests pass
- Update documentation as needed
- Submit your pull request with a clear title and description
- Respond to any feedback or requested changes
Release Process¶
For maintainers:
- Update version in
pyproject.toml
following Semantic Versioning - Update
CHANGELOG.md
with all notable changes - Create a new release on GitHub with release notes
- The CI workflow will automatically publish to PyPI
Adding New Features¶
When adding new features, consider:
- Backward Compatibility: Ensure existing code continues to work
- Performance: New features should not significantly degrade performance
- Testing: Include comprehensive tests
- Documentation: Add clear documentation with examples
Questions and Support¶
If you have questions about contributing:
- Open an issue on GitHub
- Ask in the repository's discussion section
- Contact the maintainers directly
Thank you for contributing to Instructor Classify!