#! /usr/bin/make -f

export PYBUILD_NAME=pytest-twisted

# Creating and copying the .egg-info folder allows pytest to recognize the plugin even though
# it is not properly installed at package build time
ifneq ($(PYBUILD_AUTOPKGTEST),1)
export PYBUILD_BEFORE_TEST={interpreter} setup.py egg_info && cp -r {dir}/src/*.egg-info {build_dir}
export PYBUILD_AFTER_TEST=rm -rf {dir}/src/*.egg-info {build_dir}/*.egg-info
endif

# Ignore Python 3.12 deprecation warning that is triggered by twisted for now
export PYTHONWARNINGS=default,ignore::DeprecationWarning:twisted.python.failure

export PYBUILD_TEST_CUSTOM=1
export PYBUILD_TEST_ARGS={interpreter} -m pytest -v testing --reactor=default \
	&& {interpreter} -m pytest -v testing --reactor=asyncio

# See discussion in https://bugs.debian.org/965041.
export CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1


%:
	dh $@ --buildsystem=pybuild

