#!/usr/bin/make -f

UPSTREAM_GIT := https://github.com/eventlet/eventlet
include /usr/share/openstack-pkg-tools/pkgos.make

export PYBUILD_NAME=eventlet
export TRAVIS=true

%:
	dh $@ --with python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_clean:
	dh_auto_clean
	find . -iname '*.pyc' -delete
	for i in $$(find . -type d -iname __pycache__) ; do rm -rf $$i ; done

override_dh_sphinxdoc:
	PYTHONPATH=. python3 -m sphinx -N -b html doc $(CURDIR)/debian/python-eventlet-doc/usr/share/doc/python-eventlet-doc/html
	dh_sphinxdoc

override_dh_compress:
	dh_compress -X.inv -X.txt

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	set -e ; set -x ; for i in $(shell py3versions -vr 2>/dev/null) ; do \
		PYTHONPATH=. PYTHON=python$$i python$$i -m nose tests -v --exclude='.*test_018b_http_10_keepalive_framing.*' --exclude='.*test_fork_after_monkey_patch.*'; \
	done
endif
