From 102e1f1dcb1e794499fe08c337e6a74c932a0590 Mon Sep 17 00:00:00 2001 From: Miyamura80 Date: Tue, 27 Jan 2026 17:32:48 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=A8=20consolidate=20initialization?= =?UTF-8?q?=20logic=20into=20root=20Makefile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CLAUDE.md | 1 + Makefile | 16 +++++++++++++++- README.md | 1 + init/Makefile | 24 ------------------------ 4 files changed, 17 insertions(+), 25 deletions(-) delete mode 100644 init/Makefile diff --git a/CLAUDE.md b/CLAUDE.md index a8ab5ba..b814590 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,6 +10,7 @@ Super-opinionated Python stack for fast development. Python >= 3.12 required. Us ```bash # Setup & Run +make init name=... description=... # Initialize project name and description make setup # Create/update .venv and sync dependencies make all # Run main.py with setup diff --git a/Makefile b/Makefile index db241a3..fe8a3ee 100644 --- a/Makefile +++ b/Makefile @@ -32,10 +32,24 @@ help: ## Show this help message }' $(MAKEFILE_LIST) ######################################################## -# Initialization: Delete later +# Initialization ######################################################## ### Initialization +.PHONY: init banner logo +init: ## Initialize project (usage: make init name=my-project description="my description") + @if [ -z "$(name)" ] || [ -z "$(description)" ]; then \ + echo "$(RED)Error: Both 'name' and 'description' parameters are required$(RESET)"; \ + echo "Usage: make init name= description="; \ + exit 1; \ + fi + @echo "$(YELLOW)πŸš€ Initializing project $(name)...$(RESET)" + @sed -i '' "s/name = \"python-template\"/name = \"$(name)\"/" pyproject.toml + @sed -i '' "s/description = \"Add your description here\"/description = \"$(description)\"/" pyproject.toml + @sed -i '' "s/# Python-Template/# $(name)/" README.md + @sed -i '' "s/Opinionated Python project stack. πŸ”‹ Batteries included. <\/b>/$(description)<\/b>/" README.md + @echo "$(GREEN)βœ… Updated project name and description.$(RESET)" + banner: check_uv ## Generate project banner image @echo "$(YELLOW)πŸ”Generating banner...$(RESET)" @uv run python -m init.generate_banner diff --git a/README.md b/README.md index 3eaec22..0b4887f 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ Opinionated Python stack for fast development. The `saas` branch extends `main` ## Quick Start +- `make init name=my-project description="My project description"` - initialize project - `make all` - runs `main.py` - `make fmt` - runs `ruff format` + JSON formatting - `make banner` - create a new banner that makes the README nice 😊 diff --git a/init/Makefile b/init/Makefile deleted file mode 100644 index d54486a..0000000 --- a/init/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -.PHONY: all banner logo - -all: - @if [ -z "$(name)" ] || [ -z "$(description)" ]; then \ - echo "Error: Both 'name' and 'description' parameters are required"; \ - echo "Usage: make all name= description="; \ - exit 1; \ - fi - sed -i '' "s/name = \"python-template\"/name = \"$(name)\"/" ../pyproject.toml - sed -i '' "s/description = \"Add your description here\"/description = \"$(description)\"/" ../pyproject.toml - sed -i '' "s/# Python-Template/# $(name)/" ../README.md - sed -i '' "s/Description of the project here. <\/b>/$(description)<\/b>/" ../README.md - @echo "Updated project name to: $(name)" - @echo "Updated project description to: $(description)" - -banner: - @echo "🎨 Generating banner..." - @cd .. && uv run python -m init.generate_banner - @echo "βœ… Banner generated in media/banner.png" - -logo: - @echo "🎨 Generating logo and favicon..." - @cd .. && uv run python -m init.generate_logo - @echo "βœ… Logo and favicon generated in docs/public/" From c037ec7a0a7197030ee1d3dc44a1b23b1631807e Mon Sep 17 00:00:00 2001 From: Miyamura80 Date: Tue, 27 Jan 2026 17:38:32 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20fix:=20use=20portable=20sed?= =?UTF-8?q?=20syntax=20for=20Linux=20compatibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index fe8a3ee..1340ee9 100644 --- a/Makefile +++ b/Makefile @@ -44,10 +44,10 @@ init: ## Initialize project (usage: make init name=my-project description="my de exit 1; \ fi @echo "$(YELLOW)πŸš€ Initializing project $(name)...$(RESET)" - @sed -i '' "s/name = \"python-template\"/name = \"$(name)\"/" pyproject.toml - @sed -i '' "s/description = \"Add your description here\"/description = \"$(description)\"/" pyproject.toml - @sed -i '' "s/# Python-Template/# $(name)/" README.md - @sed -i '' "s/Opinionated Python project stack. πŸ”‹ Batteries included. <\/b>/$(description)<\/b>/" README.md + @sed -i.bak "s/name = \"python-template\"/name = \"$(name)\"/" pyproject.toml && rm pyproject.toml.bak + @sed -i.bak "s/description = \"Add your description here\"/description = \"$(description)\"/" pyproject.toml && rm pyproject.toml.bak + @sed -i.bak "s/# Python-Template/# $(name)/" README.md && rm README.md.bak + @sed -i.bak "s/Opinionated Python project stack. πŸ”‹ Batteries included. <\/b>/$(description)<\/b>/" README.md && rm README.md.bak @echo "$(GREEN)βœ… Updated project name and description.$(RESET)" banner: check_uv ## Generate project banner image