~crossbar/crossbar/trunk

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
.PHONY: test docs

all:
	@echo "Targets:"
	@echo ""
	@echo "   clean            Cleanup"
	@echo "   test             Run unit tests"
	@echo "   flake8           Run flake tests"
	@echo "   install          Local install"
	@echo "   publish          Clean build and publish to PyPI"
	@echo "   docs             Build and test docs"
	@echo ""

clean:
	rm -rf ./build
	rm -rf ./dist
	rm -rf ./crossbar.egg-info
	rm -rf ./.crossbar
	rm -rf ./_trial_temp
	rm -rf ./.tox
	find . -name "*.db" -exec rm -f {} \;
	find . -name "*.pyc" -exec rm -f {} \;
	find . -name "*.log" -exec rm -f {} \;
	# Learn to love the shell! http://unix.stackexchange.com/a/115869/52500
	find . \( -name "*__pycache__" -type d \) -prune -exec rm -rf {} +

news: towncrier.ini crossbar/newsfragments/*.*
	# this produces a NEWS.md file, 'git rm's crossbar/newsfragmes/* and 'git add's NEWS.md
	# ...which we then use to update docs/pages/ChangeLog.md
	towncrier
	cat docs/templates/changelog_preamble.md > docs/pages/ChangeLog.md
	cat NEWS.md >> docs/pages/ChangeLog.md
	git add docs/pages/ChangeLog.md
	echo You should now 'git commit -m "update NEWS and ChangeLog"' the result, if happy.

docs:
	towncrier --draft > docs/pages/ChangeLog.md
	python docs/test_server.py

# call this in a fresh virtualenv to update our frozen requirements.txt!
freeze:
	pip install --no-cache-dir -r requirements-in.txt
	pip freeze -r requirements-in.txt
	pip install hashin
	cat requirements-in.txt | grep -v crossbar | grep -v hashin > requirements.txt
	# FIXME: hashin each dependency in requirements.txt and remove the original entries (so no double entries are left)
	hashin click
	hashin setuptools
	hashin zope.interface
	hashin Twisted
	hashin autobahn
	hashin netaddr
	hashin PyTrie
	hashin Jinja2
	hashin mistune
	hashin Pygments
	hashin PyYAML
	hashin shutilwhich
	hashin sdnotify
	hashin psutil
	hashin lmdb
	hashin u-msgpack-python
	hashin cbor
	hashin py-ubjson
	hashin cryptography
	hashin pyOpenSSL
	hashin pyasn1
	hashin pyasn1-modules
	hashin service-identity
	hashin PyNaCl
	hashin treq
	hashin setproctitle
	hashin watchdog
	hashin argh
	hashin attrs
	hashin cffi
	hashin enum34
	hashin idna
	hashin ipaddress
	hashin MarkupSafe
	hashin pathtools
	hashin pycparser
	hashin requests
	hashin six
	hashin txaio

wheel:
	LMDB_FORCE_CFFI=1 SODIUM_INSTALL=bundled pip wheel --require-hashes --wheel-dir ./wheels -r requirements.txt

# install dependencies exactly
install_deps:
	LMDB_FORCE_CFFI=1 SODIUM_INSTALL=bundled pip install --ignore-installed --require-hashes -r requirements.txt

install:
	pip install -e .

# publish to PyPI
publish: clean
	python setup.py sdist bdist_wheel
	twine upload dist/*

test: flake8
	trial crossbar

full_test: clean flake8
	trial crossbar

# This will run pep8, pyflakes and can skip lines that end with # noqa
flake8:
	flake8 --ignore=E501,N801,N802,N803,N805,N806 crossbar

flake8_stats:
	flake8 --statistics --max-line-length=119 -qq crossbar

version:
	PYTHONPATH=. python -m crossbar.controller.cli version

pyflakes:
	pyflakes crossbar

pep8:
	pep8 --statistics --ignore=E501 -qq .

pep8_show_e231:
	pep8 --select=E231 --show-source

autopep8:
	autopep8 -ri --aggressive --ignore=E501 .

pylint:
	pylint -d line-too-long,invalid-name crossbar

find_classes:
	find crossbar -name "*.py" -exec grep -Hi "^class" {} \; | grep -iv test