-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
80 lines (67 loc) · 1.77 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
.PHONY: format
format:
black src tests *.py && isort src tests *.py
.PHONY: lint
lint:
flake8 src tests *.py && isort --check-only src tests *.py && black --check src tests *.py && mypy src tests
.PHONY: test
test:
coverage run -m pytest
coverage report
.PHONY: clean
clean:
find . -name "*.pyc" -print0 | xargs -0 rm -f
rm -Rf dist
rm -Rf *.egg-info
.PHONY: develop
develop:
pip install -U setuptools wheel
pip install -e '.[arduino,metrics,dev]'
.PHONY: sdist
sdist:
python3 setup.py sdist
.PHONY: wheel
wheel:
python3 setup.py bdist_wheel
.PHONY: release
release: clean sdist wheel
twine --version
twine upload -s dist/*
.PHONY: docs
docs:
make -C docs html
.PHONY: check-docs
check-docs:
# Doesn't generate any output but prints out errors and warnings.
make -C docs dummy
.PHONY: deb-local
deb-local: clean sdist
docker build -t afancontrol-debuild -f ./Dockerfile.debian .
docker run -it --rm \
-v `pwd`/dist:/afancontrol/dist \
-v `pwd`/debian:/afancontrol/debian \
afancontrol-debuild sh -ex -c '\
tar xaf /afancontrol/dist/afancontrol-*.tar.gz --strip 1; \
debuild -us -uc -b; \
cd ../; \
ls -alh; \
mkdir /afancontrol/dist/debian; \
cp afancontrol?* /afancontrol/dist/debian/; \
dpkg --contents afancontrol*.deb; \
'
.PHONY: deb-from-pypi
deb-from-pypi: deb-from-github # deprecated target
.PHONY: deb-from-github
deb-from-github: clean
docker build -t afancontrol-debuild -f ./Dockerfile.debian .
docker run -it --rm \
-v `pwd`/dist:/afancontrol/dist \
afancontrol-debuild sh -ex -c '\
uscan --download --overwrite-download --verbose; \
tar xaf ../afancontrol_*.orig.tar.gz --strip 1; \
debuild -us -uc; \
cd ../; \
ls -alh; \
mkdir /afancontrol/dist/debian; \
cp afancontrol?* /afancontrol/dist/debian/; \
'