#! /usr/bin/make -f

include /usr/share/dpkg/architecture.mk

export PYBUILD_NAME=kerchunk

# python3-fastparquet module not available in Debian
SKIP_ARGS=not test_single_append_parquet \
and not test_zarr_combine

# tests requiring broken or unavailable hdf5 plugins
SKIP_ARGS +=\
and not test_string_null \
and not test_string_decode \
and not test_compound_string_null \
and not test_compound_string_encode \
and not test_var \
and not test_malicious_chunks

export PYBUILD_TEST_ARGS=-v -m "not remotedata" -k "${SKIP_ARGS}" $(CURDIR)/tests
export PYBUILD_AFTER_TEST=${RM} -r {dir}/tests/__pycache__

%:
	dh $@ --buildsystem=pybuild

execute_after_dh_auto_build-indep:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	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 docs/source $(CURDIR)/.pybuild/docs/html/
	${RM} -r $(CURDIR)/.pybuild/docs/html/.doctrees
endif
