#!/usr/bin/make -f export PYBUILD_TEST_ARGS=--no-cov --ignore=tests/test_api.py --ignore=tests/test_a01_api.py -k "not test_device_trait_command_parsing" --snapshot-warn-unused export PYBUILD_AFTER_INSTALL=rm -rf {destdir}/usr/lib/python3*/dist-packages/roborock/devices/README.md %: dh $@ --buildsystem=pybuild override_dh_auto_build: dh_auto_build for py in `py3versions -s`; do \ build_dir=".pybuild/cpython3_$${py#python}/build"; \ find "$$build_dir" -type f -name "*.py" -exec sed -i 's/^from Crypto\./from Cryptodome./g' {} +; \ find "$$build_dir" -type f -name "*_pb2.py" -exec perl -0777 -i -pe \ 's/^from google\.protobuf import runtime_version[^\n]*\n//mg; s/_runtime_version\.ValidateProtobufRuntimeVersion\(.*?\)\n//sg' \ {} +; \ done override_dh_auto_test: ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) for py in `py3versions -s`; do \ build_dir=".pybuild/cpython3_$${py#python}/build"; \ cp -a tests pyproject.toml "$$build_dir/"; \ cd "$$build_dir"; \ find tests -type f -name "*.py" -exec sed -i 's/^from Crypto\./from Cryptodome./g' {} +; \ $${py} -m pytest tests ${PYBUILD_TEST_ARGS}; \ rm -r tests pyproject.toml; \ cd $(CURDIR); \ done endif