-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (21 loc) · 967 Bytes
/
Makefile
File metadata and controls
31 lines (21 loc) · 967 Bytes
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
SHELL := /bin/bash
.PHONY: sync test lint fmt web-install web-build web-preview-local check
VENV_PATH ?= /Users/shanewray/venvs/geoluck
VENV_PYTHON := $(VENV_PATH)/bin/python
VENV_PIP := $(VENV_PATH)/bin/pip
LOAD_ENV = if [ -f .env ]; then set -a; . ./.env; set +a; fi;
sync:
$(LOAD_ENV) if command -v uv >/dev/null 2>&1; then uv sync; else "$(VENV_PIP)" install -e ".[dev]"; fi
test:
$(LOAD_ENV) if command -v uv >/dev/null 2>&1; then uv run python -B -m pytest; else "$(VENV_PYTHON)" -B -m pytest; fi
lint:
$(LOAD_ENV) if command -v uv >/dev/null 2>&1; then uv run ruff check .; else "$(VENV_PYTHON)" -m ruff check .; fi
fmt:
$(LOAD_ENV) if command -v uv >/dev/null 2>&1; then uv run ruff format .; else "$(VENV_PYTHON)" -m ruff format .; fi
web-install:
$(LOAD_ENV) cd web && npm install
web-build:
$(LOAD_ENV) cd web && npm run build
web-preview-local:
$(LOAD_ENV) python3 scripts/web_preview_local.py --port $${PORT:-4173}
check: test web-build