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..1340ee9 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.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 @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/"