Source

wheezy.routing / Makefile

Andriy Kornatsky… 330dcb5 

Andriy Kornatsky… 4267c67 
Andriy Kornatsky… 85ae562 
Andriy Kornatsky… 24f7b08 
Andriy Kornatsky… acfb8d4 
Andriy Kornatsky… 24f7b08 
Andriy Kornatsky… 84a3154 


Andriy Kornatsky… bd61c69 
Andriy Kornatsky… 415fb62 
Andriy Kornatsky… cd9c6fe 
Andriy Kornatsky… 85ae562 
Andriy Kornatsky… 4267c67 
Andriy Kornatsky… bfb2796 
Andriy Kornatsky… 24f7b08 

Andriy Kornatsky… f2fb005 

Andriy Kornatsky… 24f7b08 
Andriy Kornatsky… f2fb005 

Andriy Kornatsky… bfb2796 
Andriy Kornatsky… 4267c67 
Andriy Kornatsky… 84a3154 



Andriy Kornatsky… d99617c 

Andriy Kornatsky… f2fb005 
Andriy Kornatsky… 84a3154 
Andriy Kornatsky… a6641bb 





Andriy Kornatsky… 24f7b08 
Andriy Kornatsky… 97e3e47 
Andriy Kornatsky… 6e3c839 



Andriy Kornatsky… 573eb1e 
Andriy Kornatsky… 4267c67 

Andriy Kornatsky… bfa5587 

Andriy Kornatsky… 5be1f7f 
Andriy Kornatsky… 4267c67 

Andriy Kornatsky… 84a3154 
Andriy Kornatsky… 4267c67 
Andriy Kornatsky… acfb8d4 

Andriy Kornatsky… fb6f5ab 
Andriy Kornatsky… acfb8d4 


Andriy Kornatsky… 5e64be2 


Andriy Kornatsky… acfb8d4 






Andriy Kornatsky… 330dcb5 

Andriy Kornatsky… 97e3e47 
Andriy Kornatsky… 330dcb5 


Andriy Kornatsky… 4267c67 
Andriy Kornatsky… 97e3e47 

Andriy Kornatsky… cd9c6fe 

Andriy Kornatsky… 97e3e47 

Andriy Kornatsky… cd9c6fe 

Andriy Kornatsky… 84a3154 
Andriy Kornatsky… cd9c6fe 

Andriy Kornatsky… 32aa72f 
Andriy Kornatsky… b8c5780 


Andriy Kornatsky… 528e430 
Andriy Kornatsky… 84a3154 
Andriy Kornatsky… 528e430 
Andriy Kornatsky… 32aa72f 
Andriy Kornatsky… 84a3154 
Andriy Kornatsky… 32aa72f 

Andriy Kornatsky… 84a3154 
.SILENT: clean env doctest-cover qa test doc release upload
.PHONY: clean env doctest-cover qa test doc release upload

VERSION=2.7
PYPI=http://pypi.python.org/simple
DIST_DIR=dist

PYTHON=env/bin/python$(VERSION)
EASY_INSTALL=env/bin/easy_install-$(VERSION)
PYTEST=env/bin/py.test-$(VERSION)
NOSE=env/bin/nosetests-$(VERSION)
SPHINX=/usr/bin/python /usr/bin/sphinx-build

all: clean doctest-cover test test-demos release

debian:
	apt-get -y update
	apt-get -y dist-upgrade
	# How to Compile Python from Source
	# http://mindref.blogspot.com/2011/09/compile-python-from-source.html
	apt-get -y install libbz2-dev build-essential python \
		python-dev python-setuptools python-virtualenv \
		mercurial

env:
	PYTHON_EXE=/usr/local/bin/python$(VERSION); \
	if [ ! -x $$PYTHON_EXE ]; then \
		PYTHON_EXE=/usr/bin/python$(VERSION); \
	fi;\
	VIRTUALENV_USE_SETUPTOOLS=1; \
	export VIRTUALENV_USE_SETUPTOOLS; \
	virtualenv --python=$$PYTHON_EXE \
		--no-site-packages env
	if [ "$$(echo $(VERSION) | sed 's/\.//')" -ge 30 ]; then \
		echo -n 'Upgrading distribute...'; \
		$(EASY_INSTALL) -i $(PYPI) -U -O2 distribute \
			> /dev/null 2>/dev/null; \
		echo 'done.'; \
	fi
	$(EASY_INSTALL) -i $(PYPI) -O2 coverage nose pytest \
		pytest-pep8 pytest-cov mock
	# The following packages available for python == 2.4
	if [ "$$(echo $(VERSION) | sed 's/\.//')" -eq 24 ]; then \
		$(EASY_INSTALL) -i $(PYPI) -O2 wsgiref; \
	fi
	$(PYTHON) setup.py develop -i $(PYPI)

clean:
	find src/ demos/ -type d -name __pycache__ | xargs rm -rf
	find src/ demos/ -name '*.py[co]' -delete
	rm -rf dist/ build/ MANIFEST src/*.egg-info .cache .coverage

release:
	$(PYTHON) setup.py -q bdist_egg

upload:
	REV=$$(hg head --template '{rev}');\
	sed -i "s/'0.1'/'0.1.$$REV'/" src/wheezy/routing/__init__.py ; \
	if [ "$$(echo $(VERSION) | sed 's/\.//')" -eq 27 ]; then \
		$(PYTHON) setup.py -q egg_info --tag-build .$$REV \
			sdist register upload; \
		$(EASY_INSTALL) -i $(PYPI) sphinx; \
		$(PYTHON) env/bin/sphinx-build -D release=0.1.$$REV \
			-a -b html doc/ doc/_build/;\
		python setup.py upload_docs; \
	fi; \
	$(PYTHON) setup.py -q egg_info --tag-build .$$REV \
		bdist_egg --dist-dir=$(DIST_DIR) \
		rotate --match=$(VERSION).egg --keep=1 --dist-dir=$(DIST_DIR) \
		upload;

qa:
	if [ "$$(echo $(VERSION) | sed 's/\.//')" -eq 27 ]; then \
		flake8 --max-complexity 9 demos doc src setup.py && \
		pep8 demos doc src setup.py ; \
	fi

test:
	$(PYTEST) -q -x --pep8 --doctest-modules \
		src/wheezy/routing

doctest-cover:
	$(NOSE) --stop --with-doctest --detailed-errors \
		--with-coverage --cover-package=wheezy.routing

test-cover:
	$(PYTEST) -q --cov wheezy.routing \
		--cov-report term-missing \
		src/wheezy/routing/tests

doc:
	$(SPHINX) -a -b html doc/ doc/_build/

test-demos:
	$(PYTEST) -q -x --pep8 demos/

run-hello:
	$(PYTHON) demos/hello/helloworld.py

run-time:
	$(PYTHON) demos/time/app.py