#!/usr/bin/make -f

export DH_VERBOSE=1
export PYBUILD_NAME=requests-toolbelt

# Ignore tests that read setup.py file.
export PYBUILD_TEST_ARGS=-k 'not test_reads_open_file_objects \
			and not test_reads_open_file_objects_using_to_string \
			and not test_reads_open_file_objects_with_a_specified_filename \
			and not test_dump_response \
			and not test_dump_all \
			and not test_prepared_request_override_base \
			and not test_prepared_request_with_base \
			and not test_request_override_base \
			and not test_request_with_base'

%:
	dh $@ --with python3 --buildsystem=pybuild

override_dh_installdocs:
	LC_ALL=C PYTHONPATH=. http_proxy='http://127.0.0.1:9/' sphinx-build -N -bhtml docs debian/html
	dh_installdocs
	dh_sphinxdoc

override_dh_auto_clean:
	$(RM) -r debian/html
	dh_auto_clean

override_dh_installchangelogs:
	dh_installchangelogs HISTORY.rst
	# Remove backup file included in distribution by mistake
	$(RM) debian/*/usr/lib/*/dist-packages/requests_toolbelt/multipart/.encoder.py.swp
