Thank you for your interest in contributing! This document provides guidelines and information for contributors.
- Python 3.10+
- Git and Git LFS
- GitHub account
git clone https://github.com/kubeservice-stack/hf-sync-action.git
cd hf-sync-action
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"pytest tests/ -vruff check src/ tests/
ruff format src/ tests/- Fork the repository
- Create a branch:
git checkout -b feature/your-feature - Make changes and write tests
- Run tests:
pytest tests/ -v - Run lint:
ruff check src/ tests/ - Commit:
git commit -m "Add feature: description" - Push:
git push origin feature/your-feature - Open a Pull Request
- We use ruff for linting and formatting
- Line length: 100 characters
- Target Python versions: 3.10–3.12
- Use type hints where practical
- Follow existing patterns in the codebase
src/
├── adapters/ # Platform adapters (HuggingFace, ModelScope)
├── config.py # Configuration loading and validation
├── change_detector.py # File-level change detection
├── sync_engine.py # Main sync orchestration
├── models.py # Data models (dataclasses)
├── report.py # Report generation
└── utils.py # Utility functions
tests/ # Test suite
config/ # Example configurations
examples/ # Ready-to-use configs and workflows
- Unit tests: Mock external API calls, test logic in isolation
- Integration tests: Use
MockAdapterfor end-to-end flow testing - E2E tests: Real API calls with small models (requires secrets)
All new features should include tests. Bug fixes should include a regression test.
- Ensure all tests pass
- Update documentation if applicable
- Add an entry to CHANGELOG.md under "Unreleased"
- Request review from maintainers
Use GitHub Issues:
- Bug reports: Use the Bug Report template
- Feature requests: Use the Feature Request template
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.