Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Set up Python
uses: actions/setup-python@v6
Expand All @@ -32,7 +35,7 @@ jobs:
sudo chmod +x /usr/local/bin/yq

- name: Install cookiecutter
run: pip install cookiecutter
run: uv pip install --system cookiecutter

- name: Run cookiecutter template
run: |
Expand Down
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ Since this is a Cookiecutter template you should expect to encounter Jinja2 temp
When being asked to test functionality that requires you to create a new project from the template create them in the `workspaces` directory.

When creating new files for optional services make sure you include them in the post_gen_project.py configuration so that unneeded files are removed. For example, if the caching functionality is not enabled the system should remove all of the caching related files.

## Key Technologies

This template uses **uv** for Python version management and package installation instead of pyenv and pip. uv provides 10-100x faster installations and automatically handles Python version downloads. All makefiles, dockerfiles, and CI workflows use uv.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Transform any Python idea into a production-ready project in minutes. This Cooki
- **AI Ready**: Pre-configured AGENTS.md file following the open standard compatible with Cursor, Aider, GitHub Copilot, and other AI coding assistants
- **Incredibly Flexible**: Mix and match features to create exactly what you need, from simple libraries to full web applications with automatic cleanup of unused code
- **Modern Python Standards**: Python 3.10+ with async/await support, type hints, contemporary best practices, and pyproject.toml configuration
- **Zero Manual Setup**: UV automatically downloads and installs the correct Python version - no need for pyenv or manual Python installation

## Quick Start

Expand All @@ -34,7 +35,8 @@ Every project created with this template includes these essential components:

- **[Makefile](https://www.gnu.org/software/make/manual/html_node/Introduction.html) automation**: Powerful task automation covering setup, testing, formatting, linting, and deployment with simple commands like `make install`, `make test`, and `make publish`
- **Modern pyproject.toml**: Centralized project configuration using the modern Python standard, eliminating legacy setup.py files and consolidating all metadata, dependencies, and tool settings in one place
- **Virtual environment management**: Seamless virtual environment creation and activation with automatic [pyenv](https://github.com/pyenv/pyenv) integration for managing Python versions across development teams
- **[uv](https://docs.astral.sh/uv/)**: Lightning-fast Python package installer and virtual environment manager written in Rust, providing 10-100x faster installations than pip with automatic Python version management
- **Virtual environment management**: Seamless virtual environment creation using uv, automatically installing the correct Python version from `.python-version` and managing dependencies efficiently
- **[Pre-commit](https://pre-commit.com/) hooks**: Automated code quality checks that run before every commit, catching formatting issues, security vulnerabilities, and common mistakes before they enter your repository

### Code Quality
Expand Down
4 changes: 1 addition & 3 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
remove_paths.add(f'docs/dev/github.md')

if not INCLUDE_REQUIREMENTS_FILES:
remove_paths.add('.github/workflows/lockfiles.yaml')
remove_paths.add(f'docs/dev/dependencies.md')

if not INCLUDE_AGENT_INSTRUCTIONS:
Expand Down Expand Up @@ -132,6 +131,5 @@ def run_command(command):


run_command('make all')
if INCLUDE_REQUIREMENTS_FILES:
run_command('make dependencies')
run_command('make lock')
run_command('make chores')
24 changes: 23 additions & 1 deletion hooks/pre_gen_project.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
import shutil
import sys

MODULE_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]+$"
Expand All @@ -7,6 +8,27 @@

if not re.match(MODULE_REGEX, module_name):
print("ERROR: %s is not a valid Python module name!" % module_name)

# exits with status 1 to indicate failure
sys.exit(1)

# Check if UV is installed
if not shutil.which("uv"):
print("\n" + "=" * 80)
print("ERROR: UV is not installed!")
print("=" * 80)
print("\nThis template requires UV for Python package management.")
print("\nTo install UV, run one of the following commands:")
print("\n # On macOS and Linux:")
print(" curl -LsSf https://astral.sh/uv/install.sh | sh")
print("\n # Using pip:")
print(" pip install uv")
print("\n # Using pipx:")
print(" pipx install uv")
print("\n # Using Homebrew:")
print(" brew install uv")
print("\nFor more installation options, visit: https://docs.astral.sh/uv/getting-started/installation/")
print("\nAfter installing UV, you can regenerate this project using cookiecutter's replay feature:")
print(" cookiecutter --replay gh:tedivm/robs_awesome_python_template")
print("\nOr run the original cookiecutter command again.")
print("=" * 80 + "\n")
sys.exit(1)
2 changes: 1 addition & 1 deletion {{cookiecutter.__package_slug}}/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
!/pyproject.toml
!/README.md
!/setup.*
!/requirements*
!/uv.lock
34 changes: 34 additions & 0 deletions {{cookiecutter.__package_slug}}/.github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,37 @@ updates:
directory: "/"
schedule:
interval: "weekly"
cooldown:
default-days: 7
open-pull-requests-limit: 5
rebase-strategy: auto
groups:
github-actions:
patterns:
- "*"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
cooldown:
default-days: 7
open-pull-requests-limit: 5
rebase-strategy: auto
groups:
python-dependencies:
patterns:
- "*"

- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"
cooldown:
default-days: 7
open-pull-requests-limit: 5
rebase-strategy: auto
groups:
uv-dependencies:
patterns:
- "*"
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ jobs:
alembic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

{%- raw %}
- name: Install uv
uses: astral-sh/setup-uv@v7

- uses: actions/setup-python@v6
with:
Expand All @@ -19,3 +23,4 @@ jobs:

- name: Check for Un-Generated Migrations
run: make check_ungenerated_migrations
{%- endraw %}
5 changes: 4 additions & 1 deletion {{cookiecutter.__package_slug}}/.github/workflows/black.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7

- uses: actions/setup-python@v6
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ jobs:
dapperdata:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7

- uses: actions/setup-python@v6
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Check out the repo
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Log in to the Container registry
uses: docker/login-action@v3
Expand Down
32 changes: 0 additions & 32 deletions {{cookiecutter.__package_slug}}/.github/workflows/lockfiles.yaml

This file was deleted.

5 changes: 4 additions & 1 deletion {{cookiecutter.__package_slug}}/.github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7

- uses: actions/setup-python@v6
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ jobs:
paracelsus:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7

- uses: actions/setup-python@v6
with:
Expand Down
5 changes: 4 additions & 1 deletion {{cookiecutter.__package_slug}}/.github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true

- name: Install uv
uses: astral-sh/setup-uv@v7

- uses: actions/setup-python@v6
with:
python-version-file: .python-version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ jobs:
matrix:
version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7

- uses: actions/setup-python@v6
with:
Expand Down
5 changes: 4 additions & 1 deletion {{cookiecutter.__package_slug}}/.github/workflows/ruff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7

- uses: actions/setup-python@v6
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ jobs:
tomlsort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7

- uses: actions/setup-python@v6
with:
Expand Down
Loading