Contributing¶
Development Setup¶
Clone the repository:
git clone https://github.com/mementum/backtrader.git
cd backtrader
Create virtual environment:
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
Install development dependencies:
pip install -e ".[dev]"
Code Style¶
Follow PEP 8 guidelines
Use Google-style docstrings
Maximum line length: 100 characters
Use type hints where possible
Running Tests¶
# Run all tests
pytest
# Run specific test
pytest tests/test_strategy.py
# Run with coverage
pytest --cov=backtrader
Documentation¶
Build documentation:
cd docs
make html # English
make html-zh # Chinese
Pull Request Guidelines¶
Fork the repository
Create a feature branch
Write tests for new features
Update documentation
Submit pull request
Commit Messages¶
Use conventional commit format:
feat: Add new featurefix: Fix bugdocs: Update documentationtest: Add testsrefactor: Code refactoring