#1151396 dh-python: several packages FTBFS with error "XXX includes a common build directory name 'tests' as a module."

#1151396#5
Date:
2026-10-20 10:33:14 UTC
From:
To:
Dear maintainer:

The packages in the affects line all fail to build in a similar way:

E: dh_python3 fs:312: python3-sorted-nearest includes a common build directory name 'tests' as a module. Likely due to a mis-configured build system installing things it shouldn't.

(That's how src:sorted-nearest fails, as an example).

If this is not a bug in dh-python, please clone and reassign to each of the affected packages, possibly
with a brief explanation of what maintainers are supposed to do.

Thanks.

#1151396#12
Date:
2026-10-20 13:33:09 UTC
From:
To:
Control: clone -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18
Control: reassign -1 src:appdata
Control: reassign -2 src:busco
Control: reassign -3 src:dissononce
Control: reassign -4 src:django-distill
Control: reassign -5 src:dogtail2
Control: reassign -6 src:gitsome
Control: reassign -7 src:mkdocs-macros-plugin
Control: reassign -8 src:palettable
Control: reassign -9 src:pkb-client
Control: reassign -10 src:pocsuite3
Control: reassign -11 src:python-jira
Control: reassign -12 src:python-multidict
Control: reassign -13 src:python-pantomime
Control: reassign -14 src:python-serializable
Control: reassign -15 src:python-sparkpost
Control: reassign -16 src:python-threadloop
Control: reassign -17 src:sbws
Control: reassign -18 src:sorted-nearest

Hi Santiago (2026.10.20_10:33:14_+0000)

This is a new feature in dh-python, detecting likely build
misconfiguration (as the message states).

building sorted-nearest attempts to install:

sorted-nearest-0.0.41+dfsg/debian/python3-sorted-nearest/usr/lib/python3/dist-packages/tests
sorted-nearest-0.0.41+dfsg/debian/python3-sorted-nearest/usr/lib/python3/dist-packages/tests/test_ties.py
sorted-nearest-0.0.41+dfsg/debian/python3-sorted-nearest/usr/lib/python3/dist-packages/tests/conftest.py

That's clearly wrong, and inappropriate.
I note that the version in unstable doesn't include these files, and it
isn't immediately obvious to me where the regression is. Probably in
setuptools.

But the package includes in pyproject:

[tool.setuptools.packages.find]
where = ["."]

That should really have some includes or excludes.

I checked appdata and busco, both have the same issue. Let's assume that
all of these packages are affected.

Stefano