#!/usr/bin/make -f

export PYBUILD_NAME=stac_check
export PYBUILD_TEST_ARGS=-v -m "not network" $(CURDIR)/tests
export PYBUILD_BEFORE_TEST=cp -r sample_files/ {build_dir}
export PYBUILD_AFTER_TEST=rm -rf {build_dir}/sample_files/

%:
	dh $@ --buildsystem=pybuild

execute_after_dh_auto_build-indep:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	cd docs && \
	PYTHONPATH=$(CURDIR) http_proxy='http://127.0.0.1:9/' https_proxy='https://127.0.0.1:9/' \
	sphinx-build -N -E -T -b html . $(CURDIR)/.pybuild/docs/html/
	rm -rf $(CURDIR)/.pybuild/docs/html/.doctrees
endif

execute_after_dh_install:
	$(RM) -r debian/python3-stac-check/usr/bin
