#!/usr/bin/make -f

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

export PYBUILD_NAME=pynndescent
export PYTHONPATH=$(CURDIR)

%:
	dh $@ --buildsystem=pybuild

# Avoid chicken-egg problem with importlib.metadata.version()
override_dh_auto_build:
	sed -i "s/^__version__.*/__version__ = '$(DEB_VERSION_UPSTREAM)'/" pynndescent/__init__.py
	dh_auto_build

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test -- --system=custom --test-args="PYTHONPATH={build_dir} {interpreter} -m pytest -v $(CURDIR)/pynndescent/tests"
endif
