Thank you for your interest in contributing to the nutrient-dws Python client library! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to abide by our Code of Conduct: be respectful, inclusive, and constructive in all interactions.
- Check if the issue already exists in GitHub Issues
- If not, create a new issue with:
- Clear, descriptive title
- Detailed description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Python version and OS
- Relevant code snippets or error messages
- Check existing issues and pull requests
- Open an issue with the "enhancement" label
- Describe the feature and its use case
- Explain why it would be valuable
-
Fork the repository
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/nutrient-dws-client-python.git cd nutrient-dws-client-python -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install development dependencies:
pip install -e ".[dev]" pre-commit install
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following our coding standards
-
Run tests:
pytest
-
Run type checking:
mypy src/
-
Run linting:
ruff check src/
-
Commit your changes:
git add . git commit -m "feat: add new feature"
Follow Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation changestest:Test changesrefactor:Code refactoringchore:Maintenance tasks
-
Push and create a pull request
- Title: Use conventional commit format
- Description: Include:
- Summary of changes
- Related issue numbers
- Breaking changes (if any)
- Screenshots (if applicable)
- Tests: Add tests for new features
- Documentation: Update relevant documentation
- Code Quality: Ensure all checks pass
- Style: Follow PEP 8, enforced by ruff
- Type Hints: Use type annotations for all public APIs
- Docstrings: Google-style docstrings for all public functions
- Testing: Aim for >90% test coverage
- Error Handling: Use appropriate exception types
- Write unit tests for new functionality
- Include integration tests for API interactions
- Mock external API calls in unit tests
- Use pytest fixtures for common test data
Example test:
def test_new_feature():
"""Test description."""
client = NutrientClient(api_key='your_api_key')
result = client.new_feature()
assert result == expected_value- Update docstrings for API changes
- Update README.md if adding new features
- Update CHANGELOG.md following Keep a Changelog format
- Add examples for new functionality
- Update version in
pyproject.toml - Update CHANGELOG.md
- Create release notes
- Tag release:
git tag v0.1.0 - Push tags:
git push --tags
- Open an issue for questions
- Check existing documentation
- Review closed issues and PRs
Thank you for contributing!