generated from cvxgrp/simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (43 loc) · 1.3 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.DEFAULT_GOAL := help
SHELL=/bin/bash
UNAME=$(shell uname -s)
.PHONY: install
install: ## Install a virtual environment
@curl -LsSf https://astral.sh/uv/install.sh | sh
@uv sync -vv
@echo 'Please perform'
@echo 'source .venv/bin/activate'
.PHONY: fmt
fmt: ## Run autoformatting and linting
@uv pip install pre-commit
@uv run pre-commit install
@uv run pre-commit run --all-files
.PHONY: test
test: install ## Run tests
@uv run pytest
.PHONY: clean
clean: ## Clean up caches and build artifacts
@git clean -X -d -f
.PHONY: coverage
coverage: install ## test and coverage
@uv run coverage run --source=cvx/. -m pytest
@uv run coverage report -m
@uv run coverage html
@if [ ${UNAME} == "Darwin" ]; then \
open htmlcov/index.html; \
elif [ ${UNAME} == "linux" ]; then \
xdg-open htmlcov/index.html 2> /dev/null; \
fi
.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
.PHONY: marimo
marimo: install ## Start marimo
@uv pip install marimo
@uv run marimo edit book/marimo
# $(argument)
#.PHONY: boil
#boil: ## Update the boilerplate code
# @poetry run pip install cvxcooker
# @poetry run cook pyproject.toml