-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
47 lines (32 loc) · 1.06 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
## Development, build and maintenance tasks
VENVS = $(shell tox -l)
VENVS = $(shell tox -l)
## Top-level targets
.PHONY: all
all: upgrade .git/hooks/pre-commit
.PHONY: format
format: var/log/tox-recreate.log
.tox/lint/bin/autoflake -r -i --remove-all-unused-imports \
--remove-duplicate-keys --remove-unused-variables \
--remove-unused-variables ./
.tox/lint/bin/autopep8 -v -i -r ./
.tox/lint/bin/black ./
.PHONY: test
test: all format
tox
.PHONY: upgrade
upgrade: .git/hooks/pre-commit .git/hooks/pre-push
make -j $(words $(VENVS:%=upgrade-%)) $(VENVS:%=upgrade-%)
## Real targets
var/log:
mkdir -p "$(@)"
var/log/tox-recreate.log: var/log setup.py setup.cfg tox.ini
tox -r --notest -v | tee "$(@)"
.git/hooks/pre-commit: var/log/tox-recreate.log
.tox/lint/bin/pre-commit install
.git/hooks/pre-push: var/log/tox-recreate.log
.tox/lint/bin/pre-commit install --hook-type pre-push
.PHONY: $(VENVS:%=upgrade-%)
$(VENVS:%=upgrade-%):
.tox/$(@:upgrade-%=%)/bin/pip install -U --upgrade-strategy=eager .[dev] | \
tee .tox/$(@:upgrade-%=%)/log/pip-upgrade.log