-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (45 loc) · 1.46 KB
/
Copy pathMakefile
File metadata and controls
61 lines (45 loc) · 1.46 KB
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
60
61
default: run
# Customizable uv run command (e.g. make dev UV_RUN="uv run --python /path/to/python")
UV_RUN ?= uv run
## Dependencies
deps-js:
cd frontend; npm install
deps-js-update:
cd frontend; npx npm-check-updates -i
deps-py:
uv sync
deps-py-update:
uv pip list --outdated
uv lock --upgrade
deps: deps-js deps-py
## Build and Test
build-js:
cd frontend; npm run build
build: build-js
test-js:
cd frontend; LANG=en npm run test
test-py:
$(UV_RUN) pytest
test: test-py test-js
## Utils
run:
cd example; $(UV_RUN) fava example.beancount
# Development with live reload (parametrizable beancount file path)
# Usage: make dev LEDGER_PATH=path/to/file.LEDGER_PATH
LEDGER_FILE ?= example/example.beancount
dev:
npx concurrently --names fava,esbuild "cd $$(dirname $(LEDGER_FILE)) && PYTHONUNBUFFERED=1 $(UV_RUN) fava --debug $$(basename $(LEDGER_FILE))" "cd frontend; npm run watch"
# Usage: make dev-debug LEDGER_FILE=path/to/file.LEDGER_FILE
dev-debug:
npx concurrently --names fava,esbuild "cd $$(dirname $(LEDGER_FILE)) && PYTHONUNBUFFERED=1 LOGLEVEL=DEBUG $(UV_RUN) fava --debug $$(basename $(LEDGER_FILE))" "cd frontend; npm run watch"
lint:
cd frontend; npx tsc --noEmit
cd frontend; npm run lint
$(UV_RUN) python -m ruff check .
$(UV_RUN) mypy src/beantab
$(UV_RUN) pylint src/beantab
format:
-cd frontend; npm run lint:fix
cd frontend; npx prettier -w ../src/beantab/templates/*.css
-$(UV_RUN) python -m ruff check --fix .
$(UV_RUN) python -m ruff format .