#!/usr/bin/make -f

UPSTREAM_GIT := https://opendev.org/x/proliantutils
include /usr/share/openstack-pkg-tools/pkgos.make

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

override_dh_clean:
	dh_clean -O--buildsystem=python_distutils
	rm -rf build .testrepository

override_dh_auto_clean:
	python3 setup.py clean

override_dh_auto_test:
	echo "Do nothing..."

override_dh_auto_build:
	echo "Do nothing..."

override_dh_auto_install:
	pkgos-dh_auto_install --no-py2

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	pkgos-dh_auto_test --no-py2 'proliantutils\.tests(?!.*ilo\.test_firmware_controller\.FirmwareImageExtractorTestCase\.test_successive_calls_to_extract_method.*|.*ilo\.test_ribcl\.IloRibclTestCase\.test_update_ilo_firmware.*|.*ilo\.test_ribcl\.IloRibclTestCase\.test_update_other_component_firmware.*)'
endif

override_dh_sphinxdoc:
	PYTHON=python3 python3 -m sphinx -b html doc/source debian/python-proliantutils-doc/usr/share/doc/python-proliantutils-doc/html
	dh_sphinxdoc -O--buildsystem=python_distutils
