From 8261b7234bb4be3792da3c19449894a7624d0f78 Mon Sep 17 00:00:00 2001
From: Julian Rother <julian@cccv.de>
Date: Mon, 24 Oct 2022 17:52:54 +0200
Subject: [PATCH] Fix CI regression from 0bd26ee (Restructure tests)

0bd26ee added __init__.py files to the tests subdirectory. This had two
unwanted side-effects:

1. setuptools.find_packages() recognised the tests as a package, so they were
   included in the pip and Debian packages.
2. The Debian package build process with dh_python automatically runs tests
   with unittest. Unittest's test discovery (in contrast to pytest) only works
   if __init__.py files exist, so this step did not do anything in the past.
   Now, failing tests caused the whole CI pipeline to fail very early without
   the helpful information provided by later stages.

This change disables running any tests during the Debian package build. It also
explicitly sets the package list to "uffd".
---
 .gitlab-ci.yml | 1 +
 setup.py       | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 681a1271..97cb17bb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -31,6 +31,7 @@ build:apt:
   script:
   - ./debian/create_changelog.py uffd > debian/changelog
   - export PYBUILD_INSTALL_ARGS="--install-lib=/usr/share/uffd/ --install-scripts=/usr/share/uffd/"
+  - export DEB_BUILD_OPTIONS=nocheck
   - dpkg-buildpackage -us -uc
   - mv ../*.deb ./
   - dpkg-deb -I *.deb
diff --git a/setup.py b/setup.py
index f88514dd..794373b3 100644
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@ setup(
 	author='CCCV',
 	author_email='it@cccv.de',
 	license='AGPL3',
-	packages=find_packages(),
+	packages=['uffd'],
 	include_package_data=True,
 	zip_safe=False,
 	python_requires='>=3.7',
-- 
GitLab