forked from CZ-NIC/pyoidc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (60 loc) · 1.96 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
PROJECT_ROOT:=.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXABUILD = sphinx-autobuild
BUILDDIR = doc/_build
DOCDIR = doc/
OICDIR = src/oic
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make HTML documentation files"
@echo " livehtml to make HTML documentation files (live reload!)"
@echo " install to install the python dependencies for development"
@echo " upgrade to upgrade the python dependencies"
@echo " isort to sort imports"
.PHONY: help
clean:
rm -rf $(INDEXDIR)
rm -rf $(BUILDDIR)/*
.PHONY: clean
ALLSPHINXOPTS=-W
html:
$(SPHINXBUILD) -b html $(DOCDIR) $(BUILDDIR)/html $(ALLSPHINXOPTS)
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
.PHONY: html
livehtml:
$(SPHINXABUILD) -b html $(DOCDIR) $(BUILDDIR)/html $(ALLSPHINXOPTS)
@echo "Build finished. Watching for change ..."
.PHONY: livehtml
install:
pip install -r requirements/test.txt -e .
.PHONY: install
REQS_DIR=$(PROJECT_ROOT)/requirements
BASE_DEPS:=$(REQS_DIR)/base.txt
TEST_DEPS:=$(REQS_DIR)/test.txt
ADMIN_DEPS:=$(REQS_DIR)/admin.txt
DOC_DEPS:=$(REQS_DIR)/docs.txt
QUAL_DEPS:=$(REQS_DIR)/quality.txt
ALL_REQS:=$(BASE_DEPS) $(TEST_DEPS) $(ADMIN_DEPS) $(DOC_DEPS) $(QUAL_DEPS)
reqs: $(ALL_REQS)
upgrade:
$(RM) $(ALL_REQS)
$(MAKE) reqs PIP_COMPILE_ARGS=--rebuild
.PHONY: upgrade
$(REQS_DIR)/%.txt: PIP_COMPILE_ARGS?=
$(REQS_DIR)/%.txt: $(REQS_DIR)/%.in
pip-compile --no-header $(PIP_COMPILE_ARGS) --output-file "[email protected]" "$<" >/tmp/pip-compile.out.tmp || { \
ret=$$?; echo "pip-compile failed:" >&2; cat /tmp/pip-compile.out.tmp >&2; \
$(RM) "[email protected]" /tmp/pip-compile.out.tmp; \
exit $$ret; }
@sed -n '1,10 s/# Depends on/-r/; s/\.in/.txt/p' "$<" > "$@"
@cat "[email protected]" >> "$@"
@$(RM) "[email protected]" /tmp/pip-compile.out.tmp
isort:
isort --recursive src/ tests/
check-isort:
isort --recursive --diff --check-only src/ tests/
.PHONY: isort check-isort
check-pylama:
pylama src/ tests/
.PHONY: check-pylama