Contributing to Thyra¶
Thank you for your interest in contributing to Thyra! This document provides guidelines for contributing to this project.
Table of Contents¶
- Development Environment Setup
- Code Style Guidelines
- Testing Requirements
- Pull Request Process
- Issue Reporting Guidelines
- Communication Channels
Development Environment Setup¶
Prerequisites¶
- Python 3.11 or 3.12
- Poetry for dependency management
- Git
Setup Steps¶
-
Fork and Clone the Repository
-
Install Dependencies
-
Install Pre-commit Hooks (Recommended)
-
Verify Installation
Code Style Guidelines¶
We use automated tools to maintain consistent code style:
Formatting¶
- Black for code formatting
- isort for import sorting
- Line length: 88 characters (Black default)
Linting¶
- flake8 for code linting
- bandit for security checks
Type Hints¶
- Use type hints for all public functions
- Follow PEP 484 conventions
Running Code Quality Checks¶
# Format code
poetry run black .
poetry run isort .
# Run linting
poetry run flake8
# Run security checks
poetry run bandit -r thyra/
Testing Requirements¶
Test Types¶
-
Unit Tests - Fast tests for individual functions
-
Integration Tests - End-to-end workflow tests
Test Coverage¶
- Aim for >80% code coverage for new code
- Run tests with coverage:
Writing Tests¶
- Place unit tests in
tests/unit/ - Place integration tests in
tests/integration/ - Use descriptive test names:
test_should_convert_imzml_when_valid_file_provided - Mark tests appropriately:
@pytest.mark.unitor@pytest.mark.integration
Pull Request Process¶
Before Submitting¶
-
Create a Feature Branch
-
Make Your Changes
- Follow code style guidelines
- Add tests for new functionality
-
Update documentation if needed
-
Run Quality Checks
-
Commit Your Changes
- Use clear, descriptive commit messages
- Follow conventional commit format when possible:
Submitting the Pull Request¶
-
Push Your Branch
-
Open a Pull Request
- Use the provided PR template
- Fill out all sections completely
-
Link related issues
-
Respond to Review Feedback
- Address all reviewer comments
- Make requested changes promptly
- Ask questions if feedback is unclear
Issue Reporting Guidelines¶
Before Opening an Issue¶
- Check Existing Issues - Search for similar issues first
- Reproduce the Problem - Ensure you can consistently reproduce the issue
- Gather Information - Collect relevant system info, error messages, and sample data (if shareable)
Issue Types¶
Use the appropriate issue template:
- Bug Report - For reporting software defects
- Feature Request - For suggesting new functionality
- Question - For general questions about usage
Information to Include¶
For Bug Reports: - Operating system and version - Python version - Thyra version - Input file format and size (if relevant) - Complete error message and stack trace - Steps to reproduce
For Feature Requests: - Clear description of the desired functionality - Use case and motivation - Proposed implementation approach (if you have ideas)
Communication Channels¶
Getting Help¶
- GitHub Issues - For bug reports and feature requests
- GitHub Discussions - For general questions and community discussions
Contributing to Documentation¶
- Documentation source is in the
docs/folder - Use clear, concise language
- Include code examples where appropriate
- Test all code examples
Development Workflow¶
Typical Contribution Flow¶
- Choose an Issue
- Look for issues labeled
good-first-issueif you're new -
Comment on the issue to indicate you're working on it
-
Develop Your Solution
- Follow the development environment setup
- Make small, focused commits
-
Write tests as you go
-
Test Thoroughly
- Run the full test suite
- Test with different input formats if relevant
-
Verify performance impact for large datasets
-
Document Your Changes
- Update docstrings for modified functions
- Update user documentation if needed
- Add changelog entry for significant changes
Code of Conduct¶
Please note that this project is governed by our Code of Conduct. By participating, you agree to abide by its terms.
Versioning Policy¶
Thyra follows Semantic Versioning (SemVer):
Version Format: MAJOR.MINOR.PATCH¶
- MAJOR - Incremented for incompatible API changes
- MINOR - Incremented for backwards-compatible functionality additions
- PATCH - Incremented for backwards-compatible bug fixes
Release Process¶
- Automated Versioning - We use
python-semantic-releasefor automated version bumping -
Commit Message Format - Use conventional commits to trigger appropriate version bumps:
-
Breaking Changes - Always include
!in commit type orBREAKING CHANGE:in footer - Changelog - Automatically generated from commit messages
Development Versions¶
- Alpha/Beta releases may be created for testing:
1.2.0-alpha.1 - Release candidates before major releases:
2.0.0-rc.1
Questions?¶
If you have questions about contributing that aren't covered here, please:
- Check the existing GitHub Discussions
- Open a new discussion if your question hasn't been asked
- Tag maintainers if you need urgent clarification
Thank you for contributing to Thyra!