Skip to content

Commit 2e4aded

Browse files
committedJan 31, 2018
beets-alternatives: Fix tests against beets 1.4.6
Since the bump of beets to version 1.4.6 in e5fab33 the tests no longer run successfully because beets 1.4.6 introduces a breaking API change for the Item.move() method which now instead of just passing copy=True the operation is now passed using a different "operation" keyword argument. Unfortunately the original repository of beets-alternatives is unmaintained since 3 years and thus there is no upstream fix available at the moment. However, there is a fork maintained by @wisp3rwind, which addresses this problem (wisp3rwind/beets-alternatives@33c6525) and a bunch of other fixes. The reason why I'm not using the patch from @wisp3rwind is that it simply doesn't apply against beets-alternatives 0.8.2, but my patch here essentially does the same. Signed-off-by: aszlig <aszlig@nix.build> Upstream issue: geigerzaehler/beets-alternatives#13 Cc: @Profpatsch
1 parent ad78ba1 commit 2e4aded

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
 
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git a/test/helper.py b/test/helper.py
2+
index c216226..d409c09 100644
3+
--- a/test/helper.py
4+
+++ b/test/helper.py
5+
@@ -11,6 +11,7 @@ import beets
6+
from beets import plugins
7+
from beets import ui
8+
from beets.library import Item
9+
+from beets.util import MoveOperation
10+
11+
from beetsplug import alternatives
12+
from beetsplug import convert
13+
@@ -183,7 +184,7 @@ class TestHelper(Assertions):
14+
item = Item.from_path(os.path.join(self.fixture_dir, 'min.' + ext))
15+
item.add(self.lib)
16+
item.update(values)
17+
- item.move(copy=True)
18+
+ item.move(operation=MoveOperation.COPY)
19+
item.write()
20+
album = self.lib.add_album([item])
21+
album.albumartist = item.artist
22+
@@ -201,7 +202,7 @@ class TestHelper(Assertions):
23+
item = Item.from_path(os.path.join(self.fixture_dir, 'min.mp3'))
24+
item.add(self.lib)
25+
item.update(values)
26+
- item.move(copy=True)
27+
+ item.move(operation=MoveOperation.COPY)
28+
item.write()
29+
return item
30+

Diff for: ‎pkgs/tools/audio/beets/alternatives-plugin.nix

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ pythonPackages.buildPythonApplication rec {
1111
sha256 = "10za6h59pxa13y8i4amqhc6392csml0dl771lssv6b6a98kamsy7";
1212
};
1313

14+
patches = [ ./alternatives-beets-1.4.6.patch ];
15+
1416
postPatch = ''
1517
sed -i -e '/install_requires/,/\]/{/beets/d}' setup.py
1618
sed -i -e '/test_suite/d' setup.py

0 commit comments

Comments
 (0)
Please sign in to comment.