Bug 733 fixed
[osm/N2VC.git] / modules / libjuju / Makefile
1 BIN := .tox/py3/bin
2 PY := $(BIN)/python
3 PIP := $(BIN)/pip
4 SCHEMAGEN := $(shell which schemagen)
5 VERSION=$(shell cat VERSION)
6
7 clean:
8 find . -name __pycache__ -type d -exec rm -r {} +
9 find . -name *.pyc -delete
10 rm -rf .tox
11 rm -rf docs/_build/
12
13 .tox:
14 tox -r --notest
15
16 client: .tox
17 ifndef SCHEMAGEN
18 $(error "schemagen is not available, please install from https://github.com/juju/schemagen")
19 endif
20 $(PY) -m juju.client.facade -s "juju/client/schemas*" -o juju/client/
21
22 test:
23 tox
24
25 .PHONY: lint
26 lint:
27 tox -e lint --notest
28
29 docs: .tox
30 $(PIP) install -r docs/requirements.txt
31 rm -rf docs/_build/
32 $(BIN)/sphinx-build -b html docs/ docs/_build/
33 cd docs/_build/ && zip -r docs.zip *
34
35 release:
36 git fetch --tags
37 rm dist/*.tar.gz
38 $(PY) setup.py sdist
39 $(BIN)/twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
40 git tag ${VERSION}
41 git push --tags
42
43 upload: release
44
45
46 .PHONY: clean client test docs upload release