-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
45 lines (34 loc) · 1.22 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
projectdir ::= $(realpath .)
relgnupghome ::= test/.gnupghome
export GNUPGHOME ::= $(projectdir)/$(relgnupghome)
gpg_key_id ::= "8c2a59a7"
relpassstore ::= test/.test-password-store
export PASSWORD_STORE_DIR ::= $(projectdir)/$(relpassstore)
.PHONY: all test coverage style clean clean-pycache clean-build
all: style test
test: | $(relpassstore)
dbus-run-session -- pytest -v test
coverage: | $(relpassstore)
dbus-run-session -- python3 -m coverage run -m pytest -v test
python3 -m coverage report
style:
pycodestyle --max-line-length=159 .
black --diff .
$(relgnupghome): test/test_key.asc test/test_ownertrust.txt
@echo "===== Preparing gpg test keys in $(relgnupghome) ====="
mkdir -p -m 700 $(relgnupghome)
gpg --allow-secret-key-import --import test/test_key.asc
gpg --import-ownertrust test/test_ownertrust.txt
$(relpassstore): | $(relgnupghome)
@echo "===== Preparing password store in $(relpassstore) ====="
pypass init -p $(relpassstore) $(gpg_key_id)
clean: clean-test-environment clean-pycache clean-build
clean-test-environment:
$(RM) -r $(relpassstore)
$(RM) -r $(relgnupghome)
clean-pycache:
find . -name '__pycache__' -exec $(RM) -r {} +
clean-build:
$(RM) -r build/
$(RM) -r dist/
$(RM) -r *.egg-info