#!/usr/bin/make -f

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

export PYBUILD_NAME=structlog

# sets the version using hatch-vcs -> setuptools_scm statically, not via git
export SETUPTOOLS_SCM_PRETEND_VERSION = $(DEB_VERSION_UPSTREAM)

%:
	dh $@ --buildsystem=pybuild

execute_before_dh_auto_clean:
	make -C docs clean BUILDDIR=$(CURDIR)/.pybuild/docs

execute_before_dh_sphinxdoc:
	cp -a $(CURDIR)/.pybuild/docs/html debian/python-structlog-doc/usr/share/doc/python-structlog-doc/

execute_after_dh_auto_build:
	PYTHONPATH=$(shell pybuild --print build_dir --interpreter python3) \
	  http_proxy=http://127.0.0.1:9 \
	  https_proxy=https://127.0.0.1:9 \
	  make -C docs html BUILDDIR=$(CURDIR)/.pybuild/docs
