A simple template for Python projects with basic setup for development and testing.
- Basic structure with source code in
src/
and tests intests/
- Simple Hello World example
- Testing with pytest
- Code quality tools:
- Ruff for linting and formatting
- Pyright for type checking
- CI/CD with GitHub Actions
- Python 3.8 or newer
- pip for package management
- Clone the repository:
git clone https://github.com/yourusername/your-repo-name.git
cd your-repo-name
- Set up a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install development dependencies:
pip install -r dev-requirements.txt
python -m src.hello_world.main
Run the tests:
pytest
Check code style and lint:
ruff check .
ruff format --check .
Format code:
ruff format .
Type check with pyright:
pyright
.
├── .github/workflows # GitHub Actions workflows
├── src/ # Source code
├── tests/ # Test files
├── .gitignore # Git ignore file
├── dev-requirements.txt # Development dependencies
├── pyproject.toml # Project configuration
└── README.md # This file
This project is licensed under the MIT License - see the LICENSE file for details.