#!/usr/bin/make -f

export PYTHONDONTWRITEBYTECODE = 1
export PIP_CONFIG_FILE = /dev/null

# Override explicitly to use a trusted internal package mirror.
THEHARVESTER_PYPI_URL ?= https://pypi.org/simple

%:
	dh $@ --buildsystem=none

# Only this step uses the network. Never resolve unpinned transitive packages
# or build sdists (which could download additional build dependencies).
override_dh_auto_build:
	python3 -m pip --isolated --disable-pip-version-check download \
		--index-url "$(THEHARVESTER_PYPI_URL)" --no-cache-dir \
		--no-deps --only-binary=:all: --require-hashes \
		--dest debian/.wheelhouse -r debian/vendor-requirements.txt

override_dh_auto_install:
	python3 debian/build-venv.py --wheelhouse debian/.wheelhouse

# Upstream tests run against the staged venv in build-venv.py, after installation.
override_dh_auto_test:
