| Adam Israel | dcdf82b | 2017-08-15 15:26:43 -0400 | [diff] [blame^] | 1 | BIN := .tox/py35/bin |
| 2 | PY := $(BIN)/python3.5 |
| 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: |
| 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 | docs: .tox |
| 26 | $(PIP) install -r docs/requirements.txt |
| 27 | rm -rf docs/_build/ |
| 28 | $(BIN)/sphinx-build -b html docs/ docs/_build/ |
| 29 | cd docs/_build/ && zip -r docs.zip * |
| 30 | |
| 31 | release: |
| 32 | git remote | xargs -L1 git fetch --tags |
| 33 | $(PY) setup.py sdist upload |
| 34 | git tag ${VERSION} |
| 35 | git remote | xargs -L1 git push --tags |
| 36 | |
| 37 | upload: release |
| 38 | |
| 39 | |
| 40 | .PHONY: clean client test docs upload release |