#! /usr/bin/make -f

export PYBUILD_NAME=kerchunk

# python3-s3fs module not available on Debian
SKIP_ARGS=not test_median \
and not test_single \
and not test_single_direct_open \
and not test_parse_grib_idx_no_file \
and not test_archives \
and not test_parse_grib_idx_content \
and not test_multizarr

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

# tests requiring hdf5 plugins
# See https://github.com/fsspec/kerchunk/pull/575
SKIP_ARGS +=\
and not test_string_embed \
and not test_string_pathlib \
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

export PYBUILD_TEST_ARGS=-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
