From df52e74c8578951d467acc20d9c523bc4511e282 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Tue, 4 Feb 2025 09:00:15 +0400 Subject: [PATCH] (re)introduce Makefile --- .env | 1 - Makefile | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ taskfile.yml | 5 ----- 3 files changed, 55 insertions(+), 6 deletions(-) delete mode 100644 .env create mode 100644 Makefile delete mode 100644 taskfile.yml diff --git a/.env b/.env deleted file mode 100644 index 2251ad36..00000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -TASK_X_REMOTE_TASKFILES=1 diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..5f482147 --- /dev/null +++ b/Makefile @@ -0,0 +1,55 @@ +# Colors for pretty output +BLUE := \033[36m +BOLD := \033[1m +RESET := \033[0m + +.DEFAULT_GOAL := help + +.PHONY: help verify install fmt test marimo clean + +##@ Development Setup + +venv: + @printf "$(BLUE)Creating virtual environment...$(RESET)\n" + @curl -LsSf https://astral.sh/uv/install.sh | sh + @uv venv --python 3.12 + +install: venv ## Install all dependencies using uv + @printf "$(BLUE)Installing dependencies...$(RESET)\n" + @uv sync --dev --frozen + +##@ Code Quality + +fmt: venv ## Run code formatting and linting + @printf "$(BLUE)Running formatters and linters...$(RESET)\n" + @uv pip install pre-commit + @uv run pre-commit install + @uv run pre-commit run --all-files + +##@ Testing + +test: install ## Run all tests + @printf "$(BLUE)Running tests...$(RESET)\n" + @uv pip install pytest + @uv run pytest tests + +##@ Cleanup + +clean: ## Clean generated files and directories + @printf "$(BLUE)Cleaning project...$(RESET)\n" + @git clean -d -X -f + +##@ Marimo & Jupyter + +marimo: install ## Start a Marimo server + @printf "$(BLUE)Start Marimo server...$(RESET)\n" + @uv pip install marimo + @uv run marimo edit book/marimo + +##@ Help + +help: ## Display this help message + @printf "$(BOLD)Usage:$(RESET)\n" + @printf " make $(BLUE)$(RESET)\n\n" + @printf "$(BOLD)Targets:$(RESET)\n" + @awk 'BEGIN {FS = ":.*##"; printf ""} /^[a-zA-Z_-]+:.*?##/ { printf " $(BLUE)%-15s$(RESET) %s\n", $$1, $$2 } /^##@/ { printf "\n$(BOLD)%s$(RESET)\n", substr($$0, 5) }' $(MAKEFILE_LIST) diff --git a/taskfile.yml b/taskfile.yml deleted file mode 100644 index e8843fa7..00000000 --- a/taskfile.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: '3' - -includes: - markowitz: - taskfile: https://github.com/cvxgrp/.github.git//tasks/setup.yml?ref=main