Cookiecutter template for Python projects using uv featuring:
- Flexible project structure using the src layout
- Python version and Python dependency management with uv
- Code linting and formatting with ruff
- Testing with pytest
- Automated quality assurance with pre-commit
- CICD with GitHub Actions
- Python 3.12+
- uv
- Cookiecutter
Install Cookiecutter via uv: uv tool install cookiecutter
Generate the project structure via uv tool run cookiecutter https://github.com/slangenbach/cookiecutter-python-uv
|- .devcontainer/ <- devcontainer configuration
|- .github/ <- GitHub Actions workflows
|- .vscode/ <- VSCode configuration
|- data/ <- Data for debugging and testing
|- notebooks/ <- Jupyter notebooks
|- src/ <- Source code
|- tests/ <- Tests
|- .gitignore <- Files ignored by git
|- .pre-commit-config.yaml <- pre-commit configuration
|- .python-version <- Python version used by package
|- pyproject.toml <- Package and tooling configuration
|- README.md <- Top-level README
|- uv.lock <- uv lock file
- Run project setup:
uv sync
anduv run pre-commit install
- Create a dedicated development branch:
git checkout -b YOUR-BRANCH-NAME
- Make changes
- Run linters:
uv run pre-commit run all-files
- Run tests:
uv run pytest
- Commit changes and create a pull request