diff --git a/Makefile b/Makefile index b0ab51e..abc3d5e 100644 --- a/Makefile +++ b/Makefile @@ -1,48 +1,55 @@ +# Colors for pretty output +BLUE := \033[36m +BOLD := \033[1m +RESET := \033[0m + .DEFAULT_GOAL := help -SHELL=/bin/bash +.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 -UNAME=$(shell uname -s) +install: venv ## Install all dependencies using uv + @printf "$(BLUE)Installing dependencies...$(RESET)\n" + @uv sync --dev --frozen -.PHONY: install -install: ## Install a virtual environment - @poetry install -vv --all-extras +##@ Code Quality -.PHONY: fmt -fmt: ## Run autoformatting and linting - @poetry run pre-commit run --all-files +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 -.PHONY: test -test: install ## Run tests - @poetry run pytest +##@ Testing -.PHONY: clean -clean: ## Clean up caches and build artifacts - @git clean -X -d -f +test: install ## Run all tests + @printf "$(BLUE)Running tests...$(RESET)\n" + @uv pip install pytest + @uv run pytest src/tests +##@ Cleanup -.PHONY: coverage -coverage: install ## test and coverage - @poetry run coverage run --source=cvx/. -m pytest - @poetry run coverage report -m - @poetry run coverage html +clean: ## Clean generated files and directories + @printf "$(BLUE)Cleaning project...$(RESET)\n" + @git clean -d -X -f - @if [ ${UNAME} == "Darwin" ]; then \ - open htmlcov/index.html; \ - elif [ ${UNAME} == "linux" ]; then \ - xdg-open htmlcov/index.html 2> /dev/null; \ - fi +##@ Marimo & Jupyter -.PHONY: tree -tree: install ## make a tree - @poetry show --tree +jupyter: install ## Start a Jupyter server + @printf "$(BLUE)Start Jupyter server...$(RESET)\n" + @uv pip install jupyterlab + @uv run jupyter lab -.PHONY: help -help: ## Display this help screen - @echo -e "\033[1mAvailable commands:\033[0m" - @grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort +##@ Help -.PHONY: jupyter -jupyter: install ## Run jupyter lab - @poetry run pip install jupyterlab - @poetry run jupyter lab +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/pyproject.toml b/pyproject.toml index c627eac..d102500 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,11 +12,6 @@ dependencies = [ "scikit-learn>=1.6.1", ] - -[tool.poetry.dependencies] -cvxsimulator = "*" -scikit-learn = "*" - [tool.poetry.dev-dependencies] pytest = "8.3.4" pytest-cov = "*"