#! /usr/bin/make -f

export PYBUILD_NAME=locust
export SETUPTOOLS_SCM_PRETEND_VERSION=$(DEB_VERSION_UPSTREAM)

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

execute_before_dh_auto_build:
	echo "version = '$(DEV_VERSION_UPSTREAM)'" > locust/_version.py

override_dh_auto_test:
	# examples/test_data_management.py - attempted network access during pytest collection phase
	# TestMasterWorkerRunners times out after a long time
	-http_proxy= https_proxy= PATH=$(PATH):$(CURDIR)/debian PYBUILD_SYSTEM=custom PYBUILD_TEST_ARGS="PYTHONPATH={build_dir} {interpreter} -m pytest -v --ignore=examples/test_data_management.py -k 'not TestMasterWorkerRunners'" dh_auto_test

override_dh_installexamples:
	dh_installexamples -X.pyc

override_dh_clean:
	rm -f locust/_version.py
	dh_clean
