1default: test lint
2
3test:
4	python test_ipaddress.py
5
6lint:
7	flake8 *.py
8
9lint-if-2.7:
10	@if python --version 2>&1 | grep -q ' 2\.7\.'; then $(MAKE) lint ; fi
11
12pypi:
13	python setup.py sdist bdist_wheel upload
14
15release:
16	if test -z "${VERSION}"; then echo VERSION missing; exit 1; fi
17	sed -i "s#^\(__version__\s*=\s*'\)[^']*'\$$#\1${VERSION}'#" ipaddress.py
18	sed -i "s#^\(\s*'version':\s*'\)[^']*\('.*\)\$$#\1${VERSION}\2#" setup.py
19	git diff
20	git add ipaddress.py setup.py
21	git commit -m "release ${VERSION}"
22	git tag "v${VERSION}"
23	git push
24	git push --tags
25	$(MAKE) pypi
26
27docker-test-all: docker-test-2.6 docker-test-2.7 docker-test-3.2 docker-test-3.3
28
29docker-test-2.6:
30	docker build -t ipaddress-python2.6 . -f test-python2.6.Dockerfile
31
32docker-test-2.7:
33	docker build -t ipaddress-python2.7 . -f test-python2.7.Dockerfile
34
35docker-test-3.2:
36	docker build -t ipaddress-python3.2 . -f test-python3.2.Dockerfile
37
38docker-test-3.3:
39	docker build -t ipaddress-python3.3 . -f test-python3.3.Dockerfile
40
41clean:
42	rm -rf -- build dist ipaddress.egg-info
43
44.PHONY: default test clean pypi lint docker-test-all docker-test-2.6 docker-test-2.7 docker-test-3.2 docker-test-3.3 lint-if-2.7
45
46