A Python project template with DevOps best practices, including linting, testing, and CI/CD setup.
- 🧹 Code formatting with Black
- 📝 Import sorting with isort
- 🔍 Linting with flake8
- ✅ Testing with pytest
- 📊 Test coverage reporting
- 🔄 Pre-commit hooks
- 🚀 GitHub Actions CI/CD pipeline
-
Clone this repository:
git clone <your-repo-url> cd python-template
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install development dependencies:
pip install -r requirements-dev.txt
-
Install pre-commit hooks:
pre-commit install
pytest
# Format code with black
black .
# Sort imports with isort
isort .
flake8
python-template/
├── .github/
│ └── workflows/
│ └── ci.yml
├── src/
│ └── example/
│ ├── __init__.py
│ └── calculator.py
├── tests/
│ └── test_calculator.py
├── .flake8
├── .pre-commit-config.yaml
├── pyproject.toml
├── README.md
└── requirements-dev.txt
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.