-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
94 lines (70 loc) · 2.27 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
default: run
## Dependencies
deps-js:
cd frontend; npm install && npx puppeteer browsers install chrome
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
watch-js:
cd frontend; npm run watch
test-js:
cd frontend; LANG=en npm run test
test-js-update:
cd frontend; LANG=en npm run test -- -u
test-py:
uv run pytest
test-py-coverage:
uv run coverage run -m pytest
uv run coverage html
flatpak run org.chromium.Chromium htmlcov/index.html
test: test-py test-js
## Utils
run:
cd example; uv run fava example.beancount
dev:
npx concurrently --names fava,esbuild "cd example; PYTHONUNBUFFERED=1 uv run fava --debug example.beancount" "cd frontend; npm run watch"
dev-debug:
npx concurrently --names fava,esbuild "cd example; PYTHONUNBUFFERED=1 LOGLEVEL=DEBUG uv run fava --debug example.beancount" "cd frontend; npm run watch"
beangrow:
cd example; uv run beangrow-returns example.beancount beangrow.pbtxt reports
lint:
cd frontend; npx tsc --noEmit
cd frontend; npm run lint
uv run mypy src/fava_portfolio_returns
uv run pylint src/fava_portfolio_returns
format:
-cd frontend; npm run lint:fix
cd frontend; npx prettier -w ../src/fava_portfolio_returns/templates/*.css
-uv run ruff check --fix
uv run ruff format .
find example src/fava_portfolio_returns/test/ledger -name '*.beancount' -exec uv run bean-format -c 59 -o "{}" "{}" \;
ci:
make lint
make build
make run &
make test
make format
git diff --exit-code
## Container
container-run: container-stop
docker build -t fava-portfolio-returns-test -f Dockerfile.test .
docker run -d --name fava-portfolio-returns-test fava-portfolio-returns-test
container-stop:
docker rm -f fava-portfolio-returns-test
container-test: container-run
docker exec fava-portfolio-returns-test make test
make container-stop
container-test-js-update: container-run
docker exec fava-portfolio-returns-test make test-js-update
docker cp fava-portfolio-returns-test:/usr/src/app/frontend/tests/e2e/__snapshots__ ./frontend/tests/e2e
docker cp fava-portfolio-returns-test:/usr/src/app/frontend/tests/e2e/__image_snapshots__ ./frontend/tests/e2e
make container-stop