forked from meejah/txtorcon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
117 lines (90 loc) · 3.55 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
.PHONY: test html counts coverage sdist clean install doc integration
default: test
VERSION = 0.12.0
test:
trial --reporter=text test
tox:
tox -i http://localhost:3141/root/pypi
# see also http://docs.docker.io/en/latest/use/baseimages/
dockerbase-wheezy:
@echo 'Building a minimal "wheezy" system.'
@echo "This may take a while...and will consume about 240MB when done."
debootstrap wheezy dockerbase-wheezy
dockerbase-wheezy-image: dockerbase-wheezy
@echo 'Importing dockerbase-wheezy into docker'
tar -C dockerbase-wheezy -c . | docker import - dockerbase-wheezy
docker run dockerbase-wheezy cat /etc/issue
txtorcon-tester: Dockerfile dockerbase-wheezy-image
@echo "Creating a Docker.io container"
docker build -rm -q -t txtorcon-tester ./
integration: ## txtorcon-tester
python integration/run.py
install:
sudo apt-get install python-setuptools python-twisted python-ipaddr python-geoip python-psutil graphviz
python setup.py install
doc: docs/*.rst
cd docs && make html
-cp dist/txtorcon-${VERSION}.tar.gz docs/_build/html
coverage:
coverage run --source=txtorcon `which trial` test
coverage -a -d annotated_coverage
coverage report --show-missing
htmlcoverage:
coverage run --source=txtorcon `which trial` test
coverage -a -d annotated_coverage
coverage report --show-missing
coverage html # creates htmlcov/
sensible-browser htmlcov/index.html
# dang, this is a little annoying. maybe add a shell-script which
# looks for "coverage" or "python-coverage"??
coverage-debian:
python-coverage run --source=txtorcon `which trial` test
python-coverage -a -d annotated_coverage
python-coverage report
pep8: txtorcon/*.py test/*.py examples/*.py
pep8 --ignore=E501 $^
pep8count:
pep8 --ignore=E501,E265 $^ | wc -l
pyflakes:
pyflakes txtorcon/ examples/ test/
pyflakescount:
pyflakes txtorcon/ examples/ | wc -l
clean:
-rm -rf _trial_temp
-rm -rf build
-rm -rf dist
-rm -rf html
-rm MANIFEST
-rm `find . -name \*.py[co]`
-cd docs && make clean
-rm -rf dockerbase-wheezy
-docker rmi txtorcon-tester
-docker rmi dockerbase-wheezy
counts:
ohcount -s txtorcon/*.py
test-release: dist
./test-release.sh $(shell pwd) ${VERSION}
dist: dist/txtorcon-${VERSION}-py2-none-any.whl dist/txtorcon-${VERSION}.tar.gz
dist-sigs: dist/txtorcon-${VERSION}-py2-none-any.whl.asc dist/txtorcon-${VERSION}.tar.gz.asc
sdist: setup.py
python setup.py sdist
dist/txtorcon-${VERSION}-py2-none-any.whl:
python setup.py bdist_wheel
dist/txtorcon-${VERSION}-py2-none-any.whl.asc: dist/txtorcon-${VERSION}-py2-none-any.whl
gpg --verify dist/txtorcon-${VERSION}-py2-none-any.whl.asc || gpg --no-version --detach-sign --armor --local-user [email protected] dist/txtorcon-${VERSION}-py2-none-any.whl
dist/txtorcon-${VERSION}.tar.gz: sdist
dist/txtorcon-${VERSION}.tar.gz.asc: dist/txtorcon-${VERSION}.tar.gz
gpg --verify dist/txtorcon-${VERSION}.tar.gz.asc || gpg --no-version --detach-sign --armor --local-user [email protected] dist/txtorcon-${VERSION}.tar.gz
release:
twine upload -r pypi -c "txtorcon v${VERSION} tarball" dist/txtorcon-${VERSION}.tar.gz dist/txtorcon-${VERSION}.tar.gz.asc
twine upload -r pypi -c "txtorcon v${VERSION} wheel" dist/txtorcon-${VERSION}-py2-none-any.whl dist/txtorcon-${VERSION}-py2-none-any.whl.asc
venv:
virtualenv --never-download --extra-search-dir=/usr/lib/python2.7/dist-packages/ venv
@echo "created venv"
@echo "see INSTALL for more information; to use:"
@echo ". ./venv/bin/activate"
@echo "pip install -r requirements.txt"
@echo "pip install -r dev-requirements.txt"
@echo "python examples/monitor.py"
html: docs/README.rst
cd docs && make html