Thank you for your interest in contributing to TimestringPy! We welcome contributions from everyone, whether you're fixing a bug, adding a feature, or improving documentation.
- Python 3.10 or higher
- Git
- A GitHub account
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/your-username/TimestringPy.git cd TimestringPy - Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install the package in development mode:
pip install -e .
- Follow PEP 8 Python style guidelines
- Use type hints where appropriate
- Write clear, descriptive variable and function names
- Keep functions focused and single-purpose
- Use docstrings for all public functions and classes
Use clear and descriptive commit messages:
-
Start with
feat,fix,docs,refactorortestto indicate the type of change -
Use the present tense ("Add feature" not "Added feature")
-
Be concise but descriptive in the first line (max 50 characters)
- Use the body for detailed explanations if necessary
-
Use bullet points to summarize changes in the body
-
Write a meaningful description of what the commit does and why it is necessary
Example:
feat: add support for custom time units
- Add `custom_units` parameter to `parse_timestring`
- Allow users to define their own time units
- Update documentation with examples
This change allows users to specify custom time units
when parsing timestrings, enhancing flexibility and usability.
To make changes, please fork the repository and after you're done with your changes, create a pull request.
Run the test suite before submitting any changes:
# All tests
python -m unittest discover
# Specific test module
python -m unittest timestring.test_init.TestParseTimestring.test_basic_parsing- Write tests for all new functionality
- Follow the existing test structure in
timestring/test_init.py - Use descriptive test method names that explain what is being tested
- Include both positive and negative test cases
- Test edge cases and error conditions
Example test structure:
def test_new_feature(self):
"""Test description of what this test verifies"""
# Arrange
input_value = "test input"
expected_result = 42
# Act
result = parse_timestring(input_value)
# Assert
self.assertEqual(result, expected_result)
# Or if you want to be shorter
self.assertEqual(parse_timestring("test input"), 42)When reporting bugs, please include:
- A clear description of the bug
- Steps to reproduce the issue
- Expected vs. actual behavior
- Python version and operating system
- Minimal code example that demonstrates the issue
For new features:
- Describe the feature and its use case
- Explain why it would be valuable to other users
- Consider backwards compatibility
- Provide examples of how the feature would be used
- Start with an issue: For significant changes, create an issue first to discuss the approach
- Write tests: All new code should include appropriate tests
- Update documentation: Update README.md or docstrings as needed
- Maintain backwards compatibility: Avoid breaking existing APIs unless absolutely necessary
- Create a feature branch from
main - Make your changes following the guidelines above
- Write or update tests for your changes
- Run the test suite and ensure all tests pass
- Update documentation if necessary
- Submit a pull request with:
- Clear title and description
- Reference to any related issues
- List of changes made
- Screenshots or examples if applicable
## Description
Brief description of changes made.
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Code refactoring
## Testing
- [ ] All existing tests pass
- [ ] New tests added for new functionality
- [ ] Manual testing completed
## Related Issues
Fixes #<issue number>
## Additional Notes
Any additional information or context.
- All submissions require review before merging
- Reviews focus on code quality, functionality, and adherence to guidelines
- Be open to feedback and willing to make changes
- Reviewers will be constructive and respectful
- Keep README.md up to date with new features
- Update docstrings for any modified functions
- Include code examples for new functionality
- Consider adding usage examples to the README
If you have questions about contributing:
- Check existing issues and discussions
- Create a new discussion in the
Questionscategory - Be specific about what you need help with
Contributors will be recognized in:
- Git commit history
- Release notes for significant contributions
- Acknowledgments in documentation
Be respectful and professional in all interactions. We want to maintain a welcoming environment for contributors of all skill levels.
Thank you for contributing to TimestringPy! Your contributions help make this project better for everyone.