Control: retitle -1 towncrier: Remove temporary files created during build
Control: tags -1 + pending

On 05-Jan-2023, Chris Lamb wrote:

> This is because the testsuite generates a bunch of Python modules with
> nondeterminstic contents, which then get installed into the binary
> package.

Thanks. Specifically, these are created by Twisted Trial and then left
behind as cruft.

> Patch attached that cleans these up after running the tests.

Since the files are created during PyBuild's operation, I prefer to
instruct PyBuild how to clean it up.

I have applied this change:

=====
modified   debian/changelog
@@ -4,6 +4,7 @@ towncrier (21.9.0-3) UNRELEASED; urgency=medium
   * Declare Build-Depends for architecture-independent packages.
   * Remove a Lintian override for documentation files in wrong directory.
     The files should in fact not be in the package; Lintian is correct.
+  * Remove cruft from the build directory left there by Twisted Trial.
 
  --
 
modified   debian/rules
@@ -17,6 +17,10 @@ export PYBUILD_INSTALL_ARGS = \
 export http_proxy = http://127.0.1.1:9/
 export https_proxy = ${http_proxy}
 
+# Twisted Trial creates temporary Python modules and doesn't clean up.
+twisted_trial_cruft = ${MAIN_PYTHON_PACKAGE}.test.*
+export PYBUILD_AFTER_TEST = rm -r "{build_dir}"/${twisted_trial_cruft}
+
 ␌
 %:
        dh $@ --with python3 --buildsystem=pybuild
=====

-- 
 \       “Pinky, are you pondering what I'm pondering?” “Well, I think |
  `\        so, Brain, but I can't memorize a whole opera in Yiddish.” |
_o__)                                           —_Pinky and The Brain_ |
Ben Finney <[email protected]>

Attachment: signature.asc
Description: PGP signature

Reply via email to