Howdy all,

Recently, ‘dh_python3’ detects a “common build directory name” in the
built package, and then exits with error. Example:

=====
   dh_python3 -O--buildsystem=pybuild
E: dh_python3 fs:312: [yourpackage] includes a common build directory name 
'test' as a module. Likely due to a mis-configured build system installing 
things it shouldn't.
=====

This is a good check. But why does that directory get installed?

The “mis-configured build system installing things it shouldn't” might
in some cases be Setuptools, ignoring an explicit “exclude” directive.

This years-old issue in Setuptools explores the problem
“[BUG] options.packages.find.exclude not taking effect when 
include_package_data = True”
<URL: https://github.com/pypa/setuptools/issues/3260>.

The developer responses are along the line of “that's intentional”
without much to offer in resolving the issue. Then this issue comment
<URL: https://github.com/pypa/setuptools/issues/3260#issuecomment-4642889801>
gives a (very verbose!) explanation of what's going on.

In brief: Setuptools is, not for the first time, muddling two things
into one. A specification to *include* a directory in the built SDist
(e.g. “include the test suite directory ‘test’”), is being incorrectly
interpreted to *override* an explicit “exclude this from the built
wheel”.

The ‘packages.find.exclude’ directive is, in some conditions, ignored.
The directory, explicitly specified to be excluded from the wheel, ends
up in the wheel anyway and gets installed, where ‘dh_python3’ finds it
and (correctly) complains it shouldn't be there.

That lengthy issue comment also offers some options to work around the
bug. Which of them, or what other workaround, can we expect to work in
Debian packages?

--
 \         “Faith may be defined briefly as an illogical belief in the |
  `\                  occurrence of the improbable.” —Henry L. Mencken |
_o__)                                                                  |
Ben Finney

Attachment: signature.asc
Description: PGP signature

Reply via email to