summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seren <guillaumeseren@gmail.com>2020-06-02 01:37:42 +0200
committerJoonas Niilola <juippis@gentoo.org>2021-01-18 14:27:04 +0200
commit76a4fe776209a5c8282ac1e354b8d9bb1d81831e (patch)
treeced9224acc8d732973e8037b3e0d9f9d4c13a7a9 /media-sound/beets/files
parentmedia-sound/beets: Drop PMASK on webserver (diff)
downloadgentoo-76a4fe776209a5c8282ac1e354b8d9bb1d81831e.tar.gz
gentoo-76a4fe776209a5c8282ac1e354b8d9bb1d81831e.tar.bz2
gentoo-76a4fe776209a5c8282ac1e354b8d9bb1d81831e.zip
media-sound/beets: Fix tests + cors/audioread support
Closes: https://bugs.gentoo.org/693164 Signed-off-by: Guillaume Seren <guillaumeseren@gmail.com> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'media-sound/beets/files')
-rw-r--r--media-sound/beets/files/1.4.9-0001-compatibility-with-breaking-changes-to-the-ast-modul.patch53
-rw-r--r--media-sound/beets/files/1.4.9-0002-Disable-test_completion.patch74
2 files changed, 127 insertions, 0 deletions
diff --git a/media-sound/beets/files/1.4.9-0001-compatibility-with-breaking-changes-to-the-ast-modul.patch b/media-sound/beets/files/1.4.9-0001-compatibility-with-breaking-changes-to-the-ast-modul.patch
new file mode 100644
index 000000000000..f9268b17ca64
--- /dev/null
+++ b/media-sound/beets/files/1.4.9-0001-compatibility-with-breaking-changes-to-the-ast-modul.patch
@@ -0,0 +1,53 @@
+From 86af366abab51b45ad1b06d330d384bc810e45c9 Mon Sep 17 00:00:00 2001
+From: wisp3rwind <17089248+wisp3rwind@users.noreply.github.com>
+Date: Tue, 9 Jun 2020 19:34:31 +0200
+Subject: [PATCH] compatibility with breaking changes to the ast module
+
+new in 3.10, also backported to 3.8 and 3.9: https://github.com/python/cpython/pull/20649
+In fact, our generation of some Literals has been invalid since Python
+3.4, fix that too.
+---
+ beets/util/functemplate.py | 29 ++--
+ docs/changelog.rst | 275 ++++++++++++++++++++++++++++++++++++-
+ 2 files changed, 294 insertions(+), 10 deletions(-)
+
+diff --git a/beets/util/functemplate.py b/beets/util/functemplate.py
+index af22b790..266534a9 100644
+--- a/beets/util/functemplate.py
++++ b/beets/util/functemplate.py
+@@ -73,15 +73,26 @@ def ex_literal(val):
+ """An int, float, long, bool, string, or None literal with the given
+ value.
+ """
+- if val is None:
+- return ast.Name('None', ast.Load())
+- elif isinstance(val, six.integer_types):
+- return ast.Num(val)
+- elif isinstance(val, bool):
+- return ast.Name(bytes(val), ast.Load())
+- elif isinstance(val, six.string_types):
+- return ast.Str(val)
+- raise TypeError(u'no literal for {0}'.format(type(val)))
++ if sys.version_info[:2] < (3, 4):
++ if val is None:
++ return ast.Name('None', ast.Load())
++ elif isinstance(val, six.integer_types):
++ return ast.Num(val)
++ elif isinstance(val, bool):
++ return ast.Name(bytes(val), ast.Load())
++ elif isinstance(val, six.string_types):
++ return ast.Str(val)
++ raise TypeError(u'no literal for {0}'.format(type(val)))
++ elif sys.version_info[:2] < (3, 6):
++ if val in [None, True, False]:
++ return ast.NameConstant(val)
++ elif isinstance(val, six.integer_types):
++ return ast.Num(val)
++ elif isinstance(val, six.string_types):
++ return ast.Str(val)
++ raise TypeError(u'no literal for {0}'.format(type(val)))
++ else:
++ return ast.Constant(val)
+
+
+ def ex_varassign(name, expr):
diff --git a/media-sound/beets/files/1.4.9-0002-Disable-test_completion.patch b/media-sound/beets/files/1.4.9-0002-Disable-test_completion.patch
new file mode 100644
index 000000000000..c60e24d65898
--- /dev/null
+++ b/media-sound/beets/files/1.4.9-0002-Disable-test_completion.patch
@@ -0,0 +1,74 @@
+From f6258c2ff3f3f979d72c149e44f4eecb02cb10a2 Mon Sep 17 00:00:00 2001
+From: Guillaume Seren <guillaumeseren@gmail.com>
+Date: Tue, 29 Sep 2020 16:46:06 +0200
+Subject: [PATCH] Disable test_completion
+
+Know issue by upstream https://github.com/beetbox/beets/issues/1876
+---
+ test/test_ui.py | 50 -------------------------------------------------
+ 1 file changed, 50 deletions(-)
+
+diff --git a/test/test_ui.py b/test/test_ui.py
+index 8267c9be..bcb6c3bf 100644
+--- a/test/test_ui.py
++++ b/test/test_ui.py
+@@ -1167,56 +1167,6 @@ class PluginTest(_common.TestCase, TestHelper):
+ self.run_command('test', lib=None)
+
+
+-@_common.slow_test()
+-class CompletionTest(_common.TestCase, TestHelper):
+- def test_completion(self):
+- # Load plugin commands
+- config['pluginpath'] = [_common.PLUGINPATH]
+- config['plugins'] = ['test']
+-
+- # Do not load any other bash completion scripts on the system.
+- env = dict(os.environ)
+- env['BASH_COMPLETION_DIR'] = os.devnull
+- env['BASH_COMPLETION_COMPAT_DIR'] = os.devnull
+-
+- # Open a `bash` process to run the tests in. We'll pipe in bash
+- # commands via stdin.
+- cmd = os.environ.get('BEETS_TEST_SHELL', '/bin/bash --norc').split()
+- if not has_program(cmd[0]):
+- self.skipTest(u'bash not available')
+- tester = subprocess.Popen(cmd, stdin=subprocess.PIPE,
+- stdout=subprocess.PIPE, env=env)
+-
+- # Load bash_completion library.
+- for path in commands.BASH_COMPLETION_PATHS:
+- if os.path.exists(util.syspath(path)):
+- bash_completion = path
+- break
+- else:
+- self.skipTest(u'bash-completion script not found')
+- try:
+- with open(util.syspath(bash_completion), 'rb') as f:
+- tester.stdin.writelines(f)
+- except IOError:
+- self.skipTest(u'could not read bash-completion script')
+-
+- # Load completion script.
+- self.io.install()
+- self.run_command('completion', lib=None)
+- completion_script = self.io.getoutput().encode('utf-8')
+- self.io.restore()
+- tester.stdin.writelines(completion_script.splitlines(True))
+-
+- # Load test suite.
+- test_script_name = os.path.join(_common.RSRC, b'test_completion.sh')
+- with open(test_script_name, 'rb') as test_script_file:
+- tester.stdin.writelines(test_script_file)
+- out, err = tester.communicate()
+- if tester.returncode != 0 or out != b'completion tests passed\n':
+- print(out.decode('utf-8'))
+- self.fail(u'test/test_completion.sh did not execute properly')
+-
+-
+ class CommonOptionsParserCliTest(unittest.TestCase, TestHelper):
+ """Test CommonOptionsParser and formatting LibModel formatting on 'list'
+ command.
+--
+2.26.2
+