aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 604fd054aa303324e674c063ed64a4f588159b14 (plain)
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
default: test lint

test:
	python test_ipaddress.py

lint:
	flake8 *.py

lint-if-2.7:
	@if python --version 2>&1 | grep -q ' 2\.7\.'; then $(MAKE) lint ; fi

pypi:
	python setup.py sdist bdist_wheel upload

release:
	if test -z "${VERSION}"; then echo VERSION missing; exit 1; fi
	sed -i "s#^\(__version__\s*=\s*'\)[^']*'\$$#\1${VERSION}'#" ipaddress.py
	sed -i "s#^\(\s*'version':\s*'\)[^']*\('.*\)\$$#\1${VERSION}\2#" setup.py
	git diff
	git add ipaddress.py setup.py
	git commit -m "release ${VERSION}"
	git tag "v${VERSION}"
	git push
	git push --tags
	$(MAKE) pypi

docker-test-all: docker-test-2.6 docker-test-2.7 docker-test-3.2 docker-test-3.3

docker-test-2.6:
	docker build -t ipaddress-python2.6 . -f test-python2.6.Dockerfile

docker-test-2.7:
	docker build -t ipaddress-python2.7 . -f test-python2.7.Dockerfile

docker-test-3.2:
	docker build -t ipaddress-python3.2 . -f test-python3.2.Dockerfile

docker-test-3.3:
	docker build -t ipaddress-python3.3 . -f test-python3.3.Dockerfile

clean:
	rm -rf -- build dist ipaddress.egg-info

.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