blob: 38dcc1195dd25a18ccfef8804a4b5f25293d8f0a [file] [log] [blame]
Adam Israelc3e6c2e2018-03-01 09:31:50 -05001BIN := .tox/py3/bin
2PY := $(BIN)/python
Adam Israeldcdf82b2017-08-15 15:26:43 -04003PIP := $(BIN)/pip
4SCHEMAGEN := $(shell which schemagen)
5VERSION=$(shell cat VERSION)
6
7clean:
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
Adam Israelcaf6efb2019-03-27 19:07:43 -040016client: .tox
Adam Israeldcdf82b2017-08-15 15:26:43 -040017ifndef SCHEMAGEN
18 $(error "schemagen is not available, please install from https://github.com/juju/schemagen")
19endif
20 $(PY) -m juju.client.facade -s "juju/client/schemas*" -o juju/client/
21
22test:
23 tox
24
Adam Israelcaf6efb2019-03-27 19:07:43 -040025.PHONY: lint
26lint:
27 tox -e lint --notest
28
Adam Israeldcdf82b2017-08-15 15:26:43 -040029docs: .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
35release:
Adam Israelc3e6c2e2018-03-01 09:31:50 -050036 git fetch --tags
Adam Israelcaf6efb2019-03-27 19:07:43 -040037 rm dist/*.tar.gz
38 $(PY) setup.py sdist
39 $(BIN)/twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
Adam Israeldcdf82b2017-08-15 15:26:43 -040040 git tag ${VERSION}
Adam Israelc3e6c2e2018-03-01 09:31:50 -050041 git push --tags
Adam Israeldcdf82b2017-08-15 15:26:43 -040042
43upload: release
44
45
46.PHONY: clean client test docs upload release