[go: up one dir, main page]

File: Makefile

package info (click to toggle)
txtorcon 18.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,672 kB
  • sloc: python: 17,521; makefile: 227
file content (139 lines) | stat: -rw-r--r-- 4,448 bytes parent folder | download
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
.PHONY: test html counts coverage sdist clean install doc integration diagrams
default: test
VERSION = 18.3.0

test:
	PYTHONPATH=. trial --reporter=text test

tox:
	tox -i http://localhost:3141/root/pypi

diagrams:
	automat-visualize --image-directory ./diagrams --image-type png txtorcon

diagrams:
	automat-visualize --image-directory ./diagrams --image-type png txtorcon

# 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

# see also http://docs.docker.io/en/latest/use/baseimages/
dockerbase-jessie:
	@echo 'Building a minimal "jessie" system.'
	@echo "This may take a while...and will consume about 240MB when done."
	debootstrap jessie dockerbase-jessie

dockerbase-jessie-image: dockerbase-jessie
	@echo 'Importing dockerbase-jessie into docker'
	tar -C dockerbase-jessie -c . | docker import - dockerbase-jessie
	docker run dockerbase-jessie cat /etc/issue

txtorcon-tester: Dockerfile dockerbase-jessie-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-ipaddress graphviz
	python setup.py install

doc: docs/*.rst
	cd docs && make html
	-cp dist/txtorcon-${VERSION}.tar.gz docs/_build/html

coverage:
	PYTHONPATH=. coverage run --source=txtorcon `which trial` test
	cuv graph

htmlcoverage:
	coverage run --source=txtorcon `which trial` test
	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
	pycodestyle --ignore=E501 $^

pep8count:
	pycodestyle --ignore=E501,E265 $^ | wc -l

pyflakes:
	pyflakes txtorcon/ examples/ test/

pyflakescount:
	pyflakes txtorcon/ examples/ | wc -l

clean:
	-rm twisted/plugins/dropin.cache
	-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-jessie
	-docker rmi txtorcon-tester
	-docker rmi dockerbase-jessie

counts:
	ohcount -s txtorcon/*.py

test-release: dist
	./scripts/test-release.sh $(shell pwd) ${VERSION}

dist: dist/txtorcon-${VERSION}-py2.py3-none-any.whl dist/txtorcon-${VERSION}.tar.gz

dist-sigs: dist/txtorcon-${VERSION}-py2.py3-none-any.whl.asc dist/txtorcon-${VERSION}.tar.gz.asc

sdist: setup.py
	python setup.py check
	python setup.py sdist

dist/txtorcon-${VERSION}-py2.py3-none-any.whl:
	python setup.py check
	python setup.py bdist_wheel --universal

dist/txtorcon-${VERSION}-py2.py3-none-any.whl.asc: dist/txtorcon-${VERSION}-py2.py3-none-any.whl
	gpg --verify dist/txtorcon-${VERSION}-py2.py3-none-any.whl.asc || gpg --pinentry loopback --no-version --detach-sign --armor --local-user meejah@meejah.ca dist/txtorcon-${VERSION}-py2.py3-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 --pinentry loopback --no-version --detach-sign --armor --local-user meejah@meejah.ca 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.py3-none-any.whl dist/txtorcon-${VERSION}-py2.py3-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/*.rst
	cd docs && make html

html-server: html
	twistd -n web --path docs/_build/html --port tcp:9999:interface=localhost