#!/usr/bin/make -f

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

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

override_dh_auto_install:
	pkgos-dh_auto_install

override_dh_clean:
	dh_clean -O--buildsystem=python_distutils
	find . -iname '*.pyc' -delete
	rm -rf .eggs

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	pkgos-dh_auto_test 'taskflow\.tests\.(?!(.*test_examples\.ExamplesTestCase.*|.*worker_based\.test_protocol\.TestProtocol\.test_to_dict_with_invalid_json_failures.*))'
endif

override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. PYTHON=python3 python3 -m sphinx -b html doc/source $(CURDIR)/debian/python-taskflow-doc/usr/share/doc/python-taskflow-doc/html
	dh_sphinxdoc -O--buildsystem=python_distutils
endif
