Contributions are welcome from the community. Whether fixing bugs, adding features, improving documentation, or sharing ideas, all contributions are appreciated.
-
Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/torchonnx.git cd torchonnx -
Install in development mode with dev dependencies:
pip install -e ".[dev]" -
Install pre-commit hooks:
pre-commit install
- Linting: Code must pass
ruff checkandruff format --check - Type checking: Code must pass
mypystatic analysis - Testing: All tests must pass with
pytest tests/ - Coverage: New code should include tests to maintain coverage
Run quality checks locally:
# Lint check
ruff check src/torchonnx tests
ruff format --check src/torchonnx tests
# Type check
mypy .
# Run tests
pytest tests/Note: Direct pushes to the main branch are restricted. All changes must go through Pull Requests.
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes:
- Write code following existing patterns
- Add tests for new functionality
- Update documentation if needed
- Ensure all quality checks pass
-
Commit your changes:
git add . git commit -m "Brief description of changes"
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request:
- Go to the original repository on GitHub
- Click "New Pull Request"
- Select your fork and branch
- Provide a clear description of your changes
- Reference any related issues
-
Address review feedback:
- Reviewers may request changes
- Push additional commits to the same branch
- The PR will update automatically
Run the full test suite:
pytest tests/ -vRun with coverage:
pytest tests/ --cov=src/torchonnx --cov-report=term-missingRun specific test files:
pytest tests/test_units/test_torchonnx/test_pipeline.py -v- Follow PEP 8 conventions (enforced by
ruff) - Use type hints for all function signatures
- Write docstrings using reStructuredText format
- Keep functions focused and single-purpose
- Prefer explicit over implicit
When reporting bugs or requesting features:
- Check if the issue already exists
- Provide a minimal reproducible example
- Include ONNX model details and error messages
- Specify your environment (Python version, PyTorch version, OS)