Package: beets
Version: 1.4.7-2
Severity: normal
Tags: patch
User: ubuntu-de...@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
    self._fetch_art(True)
  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

[...]

  (http://autopkgtest.ubuntu.com/packages/b/beets/focal/amd64)

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. ;)

Thanks,
-- 
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/
slanga...@ubuntu.com                                     vor...@debian.org
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),
  dh-python,
  libc-bin (>= 2.13),
- python3-all (>= 3.4),
+ python3 (>= 3.4),
  python3-bs4,
  python3-flask,
  python3-jellyfish,
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
 cd "$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
-done
+python3 -m unittest discover -p 'test_*' 2>&1

Reply via email to