-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
97 lines (71 loc) · 1.68 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
95
96
97
.PHONY: help
help: makefile
@tail -n +4 makefile | grep ".PHONY"
.PHONY: build
build:
uv build
.PHONY: test
test:
uv run pytest
.PHONY: test-receipts
test-receipts:
cd examples/receipts && \
rm -f *-corrected.jpeg && \
ls *.jpeg | while read -r file; do \
echo "Correcting $$file"; \
uv run perspectra correct $$file --output $${file%.*}-corrected.jpeg; \
done
.PHONY: edit-notebooks
edit-notebooks:
uv run marimo edit notebooks
.PHONY: install
install:
uv tool install --editable .
.PHONY: uninstall
uninstall:
uv tool uninstall perspectra
.PHONY: publish
publish: build
uv publish
# TODO: Re-enable this code
# pyFiles := $(shell find core/perspectra -name '*.py')
# # TODO: Slow startup time on first execution
# .PHONY: build-pyinstaller
# build-pyinstaller: core/perspectra/__main__.py $(pyFiles)
# pyinstaller $< \
# --paths core/perspectra \
# --noconfirm \
# --name perspectra
# # TODO: Does not work yet due to import errors
# .PHONY: build-nuitka
# build-nuitka: core/perspectra/__main__.py $(pyFiles)
# python -m nuitka \
# --standalone \
# --output-filename=perspectra \
# $<
images/logo.icns: images/icon-1024.png
nicns --in $< --out $@
# TODO: Fix this
# # Create `.app` bundle with py2app
# Perspectra.app:
# python3 setup.py py2app -A
# TODO: Fix this
# # With cx_Freeze
# Perspectra.app:
# python3 setup.py install
# python3 setup.py bdist_mac
.PHONY: clean
clean:
rm -rf __pycache__
rm -rf .ipynb_checkpoints
rm -rf .mypy_cache
rm -rf .pytest_cache
rm -rf .ruff_cache
rm -rf .venv
rm -rf *.app
rm -rf *.egg-info
rm -rf build
rm -rf dist
rm -rf perspectra.spec
rm -rf src/perspectra/__pycache__
rm -rf src/perspectra/.mypy_cache