-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (53 loc) · 1.15 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
PACKAGE_DIRS := sxhkd_parser sxhkd_parser/cli
SOURCE_FILES := $(foreach dir, $(PACKAGE_DIRS), $(wildcard $(dir)/*.py)) #$(wildcard tests/*.py)
CHECK_FILES := $(SOURCE_FILES) setup.py
# Do nothing.
.PHONY: all
all:
.PHONY: requirements
requirements:
make -C requirements
.PHONY: clean-requirements
clean-requirements:
make -C requirements clean
.PHONY: keysyms
keysyms:
make -C keysyms
tags: $(SOURCE_FILES)
ctags $(SOURCE_FILES)
# Ensure that `isort` and `black` are not run unnecessarily.
.formatted: $(CHECK_FILES)
isort $?
black $?
$(MAKE) tags
touch .formatted
.PHONY: format
format: .formatted
.PHONY: check-dev
check-dev: typecheck lint test
.PHONY: typecheck
typecheck:
mypy
.PHONY: lint
lint:
flake8 $(CHECK_FILES)
.PHONY: test
test:
pytest || true
.PHONY: clean
clean:
-rm -fr *.egg-info/
-rm -fr build/
-rm -fr dist/
-rm -f *.1 *.7
.PHONY: dist
dist: keysyms format check-dev man
python setup.py sdist bdist_wheel
twine check dist/*
.PHONY: upload
upload:
twine upload dist/*
.PHONY: man
man: man/hkfind.1 man/hkxargs.1 man/hkwatch.1 man/hkexport.1 man/hkcheck.1 man/hkdebug.1 man/sxhkd-parser.7
man/%.1 man/%.7: man/%.scd
scdoc <$< >$@