#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

export PYBUILD_NAME=python3-pyproject-api

# no python2 support herei
# test_setuptools_prepare_metadata_for_build_wheel fails due to install_requires sorting order
export PYBUILD_TEST_ARGS=-k "not test_can_build_on_python_2 and not test_setuptools_prepare_metadata_for_build_wheel"

# this sets the version using hatch-vcs -> setuptools_scm statically, instead
# through the git tag, and in turn writing it to version.py.
export SETUPTOOLS_SCM_PRETEND_VERSION = $(DEB_VERSION_UPSTREAM)

%:
	dh $@ --buildsystem=pybuild

ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
execute_after_dh_auto_build-indep: export http_proxy=127.0.0.1:9
execute_after_dh_auto_build-indep: export https_proxy=127.0.0.1:9
execute_after_dh_auto_build-indep:
	PYTHONPATH=src python3 -m sphinx -N -bhtml docs/ build/html
endif
