-
Notifications
You must be signed in to change notification settings - Fork 99
/
Makefile
69 lines (57 loc) · 1.45 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
BIN := .tox/py3/bin
PY := $(BIN)/python3
PIP := $(BIN)/pip3
VERSION := $(shell python3 -c "from juju.version import CLIENT_VERSION; print(CLIENT_VERSION)")
.PHONY: clean
clean:
find . -name __pycache__ -type d -exec rm -r {} +
find . -name *.pyc -delete
rm -rf .tox
rm -rf docs/_build/
.PHONY: .tox
.tox:
tox -r --notest
.PHONY: client
client:
tox -r --notest -e py3
$(PY) -m juju.client.facade -s "juju/client/schemas*" -o juju/client/
pre-commit run --files $(shell echo juju/client/_[cd]*.py)
.PHONY: run-unit-tests
run-unit-tests: .tox
tox -e py3
.PHONY: run-integration-tests
run-integration-tests: .tox
tox -e integration
.PHONY: run-all-tests
test: run-unit-tests run-integration-tests
.PHONY: docs
docs:
tox -e docs
.PHONY: build-test
build-test:
rm -rf venv
uv build
python3 -m venv venv
. venv/bin/activate
pip install dist/juju-${VERSION}-py3-none-any.whl
python3 -c "from juju.controller import Controller"
rm dist/*.tar.gz dist/*.whl
.PHONY: release
release:
git fetch --tags
rm dist/*.tar.gz dist/*.whl || true
uv build
uvx twine check dist/*
uvx twine upload --repository juju dist/*
git tag ${VERSION}
git push --tags
.PHONY: upload
upload: release
.PHONY: install-deb-build-deps
install-deb-build-deps:
sudo apt install -y python3-all debhelper sbuild schroot ubuntu-dev-tools
$(PIP) install stdeb
.PHONY: build-deb
build-deb: install-deb-build-deps
rm -rf deb_dist
$(PY) setup.py --command-packages=stdeb.command bdist_deb