-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
59 lines (48 loc) · 1.23 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
#: Print out this help message
help:
@grep -B1 -E "^[a-zA-Z0-9_-]+\:([^\=]|$$)" Makefile \
| grep -v -- -- \
| sed 'N;s/\n/###/' \
| sed -n 's/^#: \(.*\)###\(.*\):.*/\2###\1/p' \
| column -t -s '###'
build-all: bundle viewer deb
#: Create a Python bundle from photos and photo-viewer with shiv
bundle:
@mkdir -p bin
shiv -c photos -o ./bin/photos .
shiv -c photo-viewer -o ./bin/photo-viewer .
#: Prepare a release. Pass a release with var VERSION=1.2.3
release:
ifndef VERSION
$(error Failed making a release. Define VERSION as an argument)
endif
@echo Preparing version $(VERSION)
sed -i -E "s/--version .*/--version $(VERSION)/g" .fpm
sed -i -E "s/version = .*/version = \"$(VERSION)\"/g" pyproject.toml
git-cliff --tag $(VERSION) > CHANGELOG.md
#: Create a deb package
deb:
@mkdir -p bin
fpm -s python -t deb -p bin .
.PHONY: test
#: Run unit tests
test:
.venv/bin/pytest test/unit
.PHONY: integration-test
#: Run integration tests
integration-test:
.venv/bin/pytest test/integration
.PHONY: test-all
#: Run all tests
test-all:
.venv/bin/pytest
#: Create venv for project
venv:
python -m venv .venv
#: Install dev dependencies
dev-environment:
pip install ".[test]"
#: Clean build artifacts
clean:
rm -R bin
rm -R build