#!/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 $@ --buildsystem=pybuild

execute_before_dh_installdocs:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	LC_ALL=C PYTHONPATH=. http_proxy='http://127.0.0.1:9/' sphinx-build -N -bhtml docs debian/html
endif

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
