#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export PYBUILD_NAME=pyogrio
export PYBUILD_TEST_ARGS=\
-k "not test_url \
and not test_url_dataframe \
and not test_url_with_zip \
and not test_url_with_zip_dataframe \
and not test_uri_s3 \
and not test_uri_s3_dataframe \
and not test_read_invalid_shp \
and not test_read_layer_without_geometry \
and not test_read_force_2d \
and not test_read_layer \
and not test_read_datetime \
and not test_read_null_values \
and not test_read_fids_force_2d \
and not test_list_layers \
and not test_read_info_without_geometry \
and not test_read_arrow_to_pandas_kwargs" \
--pyargs pyogrio

%:
	dh $@ --buildsystem=pybuild

execute_after_dh_auto_build: export http_proxy=127.0.0.1:9
execute_after_dh_auto_build: export https_proxy=127.0.0.1:9
execute_after_dh_auto_build:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	cd $(shell pybuild --build -i python3 -s custom --build-args 'echo {build_dir}') && \
	PYTHONPATH=. \
	sphinx-build -N -E -T -b html $(CURDIR)/docs/source $(CURDIR)/.pybuild/docs/html
	rm -rf $(CURDIR)/.pybuild/docs/html/.doctrees
endif

execute_after_dh_auto_install:
	$(RM) debian/*/usr/lib/python3*/*-packages/pyogrio/tests/fixtures/README.md
