-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
81 lines (65 loc) · 2.04 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
###############################################################################
# Common make values.
app := mandelplot
run := pipenv run
python := $(run) python
lint := $(run) pylint
mypy := $(run) mypy
##############################################################################
# Run the plotter.
.PHONY: run
run:
$(python) $(app)
.PHONY: debug
debug:
$(run) textual run --dev $(app)
.PHONY: console
console:
$(run) textual console
##############################################################################
# Setup/update packages the system requires.
.PHONY: setup
setup: # Install all dependencies
pipenv sync --dev
.PHONY: resetup
resetup: # Recreate the virtual environment from scratch
rm -rf $(shell pipenv --venv)
pipenv sync --dev
.PHONY: depsoutdated
depsoutdated: # Show a list of outdated dependencies
pipenv update --outdated
.PHONY: depsupdate
depsupdate: # Update all dependencies
pipenv update --dev
.PHONY: depsshow
depsshow: # Show the dependency graph
pipenv graph
##############################################################################
# Checking/testing/linting/etc.
.PHONY: lint
lint: # Run Pylint over the library
$(lint) $(app)
.PHONY: typecheck
typecheck: # Perform static type checks with mypy
$(mypy) --scripts-are-modules $(app)
.PHONY: stricttypecheck
stricttypecheck: # Perform a strict static type checks with mypy
$(mypy) --scripts-are-modules --strict $(app)
.PHONY: checkall
checkall: lint stricttypecheck # Check all the things
##############################################################################
# Utility.
.PHONY: repl
repl: # Start a Python REPL
$(python)
.PHONY: help
help: # Display this help
@grep -Eh "^[a-z]+:.+# " $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.+# "}; {printf "%-20s %s\n", $$1, $$2}'
##############################################################################
# Housekeeping tasks.
.PHONY: housekeeping
housekeeping: # Perform some git housekeeping
git fsck
git gc --aggressive
git remote update --prune
### Makefile ends here