forked from canonical/python-libmaas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
91 lines (61 loc) · 1.88 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
82
83
84
85
86
87
88
89
90
91
python := python3
snapcraft := SNAPCRAFT_BUILD_INFO=1 /snap/bin/snapcraft
# ---
install-dependencies:
if [ -x /usr/bin/snap ]; then sudo snap install --classic snapcraft; fi
# ---
develop: bin/python setup.py
bin/python setup.py develop
dist: bin/python setup.py README
bin/python setup.py sdist bdist_wheel
upload: bin/python bin/twine setup.py README
bin/python setup.py sdist bdist_wheel
bin/twine upload dist/*
test: bin/tox
@bin/tox
integrate: bin/tox
@bin/tox -e integrate
format: bin/tox
@bin/tox -e format,imports
lint: bin/tox
@bin/tox -e lint,imports
clean:
$(RM) -r bin build dist include lib local share
find . -name '*.py[co]' -print0 | xargs -r0 $(RM) -r
find . -name '__pycache__' -print0 | xargs -r0 $(RM) -r
find . -name '*.egg' -print0 | xargs -r0 $(RM) -r
find . -name '*.egg-info' -print0 | xargs -r0 $(RM) -r
find . -name '*~' -print0 | xargs -r0 $(RM)
$(RM) -r .eggs .tox .coverage TAGS tags
$(RM) pip-selfcheck.json
# ---
snap-clean:
$(snapcraft) clean
snap:
$(snapcraft)
# ---
README: README.md
pandoc --from markdown --to rst --output $@ $^
docs: bin/mkdocs
bin/mkdocs build --config-file doc.yaml --clean --strict
docs-to-github: bin/mkdocs
bin/mkdocs gh-deploy --config-file doc.yaml --clean
# ---
bin/tox: bin/pip
bin/pip install --quiet --ignore-installed tox
bin/python bin/pip:
virtualenv --python=$(python) --quiet $(CURDIR)
bin/mkdocs: bin/pip
bin/pip install --quiet --ignore-installed "mkdocs >= 0.14.0"
bin/twine: bin/pip
bin/pip install --quiet --ignore-installed twine
# ---
api-json-raw := $(wildcard maas/client/bones/testing/*.raw.json)
api-json := $(patsubst %.raw.json,%.json,$(api-json-raw))
pretty: $(api-json)
%.json: %.pretty.json
cp $^ $@
%.pretty.json: %.raw.json
scripts/prettify-api-desc-doc < $^ > $@
# ---
.PHONY: install-dependencies develop dist docs docs-to-github test integrate lint clean pretty snap snap-clean