[Python-apps-team] Bug#943448: beets autopkgtest unnecessarily tests against non-default python

Steve Langasek steve.langasek at canonical.com
Thu Oct 24 21:40:22 BST 2019

Package: beets
Version: 1.4.7-2
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu focal ubuntu-patch

Dear maintainers,

With the introduction of python3.8 as a "supported" python in Ubuntu, the
beets autopkgtest is now failing because it is incompatible with python3.8:

ERROR: test_delete_original_file (test.test_art.ArtImporterTest)
Traceback (most recent call last):
  File "/tmp/autopkgtest.QpUJrP/autopkgtest_tmp/test/test_art.py", line 503, in test_delete_original_file
  File "/tmp/autopkgtest.QpUJrP/autopkgtest_tmp/test/test_art.py", line 472, in _fetch_art
    self.plugin.assign_art(self.session, self.task)
  File "/tmp/autopkgtest.QpUJrP/autopkgtest_tmp/beetsplug/fetchart.py", line 828, in assign_art
    self._set_art(task.album, candidate, not self.src_removed)
  File "/tmp/autopkgtest.QpUJrP/autopkgtest_tmp/beetsplug/fetchart.py", line 813, in _set_art
    album.set_art(candidate.path, delete)
  File "/usr/share/beets/beets/library.py", line 1148, in set_art
    artdest = self.art_destination(path)
  File "/usr/share/beets/beets/library.py", line 1122, in art_destination
    filename_tmpl = Template(
  File "/usr/share/beets/beets/util/functemplate.py", line 558, in __init__
    self.compiled = self.translate()
  File "/usr/share/beets/beets/util/functemplate.py", line 591, in translate
    func = compile_func(
  File "/usr/share/beets/beets/util/functemplate.py", line 147, in compile_func
    prog = compile(mod, '<generated>', 'exec')
TypeError: required field "posonlyargs" missing from arguments



I understand that it's useful to get early indications that your software is
incompatible with upcoming versions of python, but it's not appropriate to
use autopkgtests in this way, because beets is an application not a module
and will only ever be executed using /usr/bin/python3 on the system - you
have added an artificial test dependency on python3-all and as a result
these failing tests will artificially block the addition of python3.8 as a
supported (but not default) python version in the archive.

The attached patch adjusts the test and the build-dependencies so that the
beets tests instead test the actual behavior that is relevant to the package.

P.S. also, heads up that beets is incompatible with python3.8. ;)

Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
diff -Nru beets-1.4.7/debian/control beets-1.4.7/debian/control
--- beets-1.4.7/debian/control	2018-08-20 08:55:31.000000000 -0700
+++ beets-1.4.7/debian/control	2019-10-24 12:23:32.000000000 -0700
@@ -9,7 +9,7 @@
  debhelper (>= 10),
  libc-bin (>= 2.13),
- python3-all (>= 3.4),
+ python3 (>= 3.4),
diff -Nru beets-1.4.7/debian/tests/unittests beets-1.4.7/debian/tests/unittests
--- beets-1.4.7/debian/tests/unittests	2018-08-20 08:55:31.000000000 -0700
+++ beets-1.4.7/debian/tests/unittests	2019-10-24 12:22:59.000000000 -0700
@@ -5,8 +5,6 @@
 export LC_ALL=C.UTF-8
 export PYTHONPATH=/usr/share/beets
-pythons="$(py3versions -s)"
 cp -a test $AUTOPKGTEST_TMP
@@ -14,7 +12,4 @@
 # __path__ to ensure that their local beetsplug is used.
 ln -s /usr/share/beets/beetsplug .
-for python in $pythons; do
-	echo "=== $python ==="
-	$python -m unittest discover -p 'test_*' 2>&1
+python3 -m unittest discover -p 'test_*' 2>&1

More information about the Python-apps-team mailing list