beets: Run tests for external plugins
In order to run the tests for the external plugins of beets, we need to have beets itself as a dependency. So in order to do that, we now pass beets without plugins and tests to the nativeBuildInputs of the plugins so that we can run them. As soon as the plugins are built they become part of the final beets, which also has tests enabled, so disabling the tests for beets derivation that is used for external plugin tests is a non-issue here because they're going to be executed anyway. Enabling tests for the alternatives plugin is pretty straightforward, but in order to run tests for the copyartifacts plugin, we need to bump the source code to the latest Git master. The reason for this is that the version that was in use until now required to have the beets source directory alongside of the copyartifacts source code, but we already have beets available as a normal dependency. Updating copyartifacts to latest master largely consists of unit test changes and a few Python 3 compatibility changes. However, one change has the biggest stat, which is sbarakat/beets-copyartifacts@1a0c281da0. Fortunately, the last change is just moving the implementation to a newer API from upstream beets and by the looks of the implementation it seems to break support for moving files. However, reverting this commit also reveals that moving files was already broken before, so it wouldn't matter much whether we have this version bump or not. Tested with the following command: nix-build -E '(import ./. {}).beets.override { enableAlternatives = true; enableCopyArtifacts = true; }' Signed-off-by: aszlig <aszlig@redmoonstudios.org> Cc: @domenkozar, @pjones, @Profpatsch, @michalrus
This commit is contained in:
parent
bd2aeb4883
commit
40b76c8809
@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchFromGitHub, pythonPackages }:
|
||||
{ stdenv, fetchFromGitHub, beets, pythonPackages }:
|
||||
|
||||
pythonPackages.buildPythonApplication rec {
|
||||
name = "beets-alternatives-${version}";
|
||||
@ -16,6 +16,10 @@ pythonPackages.buildPythonApplication rec {
|
||||
sed -i -e '/test_suite/d' setup.py
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ beets pythonPackages.nose ];
|
||||
|
||||
checkPhase = "nosetests";
|
||||
|
||||
propagatedBuildInputs = with pythonPackages; [ futures ];
|
||||
|
||||
meta = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchFromGitHub, pythonPackages }:
|
||||
{ stdenv, fetchFromGitHub, beets, pythonPackages, glibcLocales }:
|
||||
|
||||
pythonPackages.buildPythonApplication rec {
|
||||
name = "beets-copyartifacts";
|
||||
@ -6,16 +6,25 @@ pythonPackages.buildPythonApplication rec {
|
||||
src = fetchFromGitHub {
|
||||
repo = "beets-copyartifacts";
|
||||
owner = "sbarakat";
|
||||
rev = "dac4a1605111e24bb5b498aa84cead7c87480834";
|
||||
sha256 = "0p5cskfgqinzh48a58hw56f96g9lar3k3g2p0ip1m9kawzf6axng";
|
||||
rev = "4a5d347c858d25641c8a0eb7d8cb1a2cac10252a";
|
||||
sha256 = "0bn6fci480ilghrdhpsjxxq29dxgni22sv1qalz770xy130g1zk3";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
sed -i -e '/install_requires/,/\]/{/beets/d}' setup.py
|
||||
sed -i -e '/namespace_packages/d' setup.py
|
||||
printf 'from pkgutil import extend_path\n__path__ = extend_path(__path__, __name__)\n' >beetsplug/__init__.py
|
||||
|
||||
# Skip test which is already failing upstream.
|
||||
sed -i -e '1i import unittest' \
|
||||
-e 's/\(^ *\)# failing/\1@unittest.skip/' \
|
||||
tests/test_reimport.py
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ beets pythonPackages.nose glibcLocales ];
|
||||
|
||||
checkPhase = "LANG=en_US.UTF-8 nosetests";
|
||||
|
||||
meta = {
|
||||
description = "Beets plugin to move non-music files during the import process";
|
||||
homepage = https://github.com/sbarakat/beets-copyartifacts;
|
||||
|
@ -1,6 +1,9 @@
|
||||
{ stdenv, fetchFromGitHub, writeScript, glibcLocales, diffPlugins
|
||||
, pythonPackages, imagemagick, gobjectIntrospection, gst_all_1
|
||||
|
||||
# Attributes needed for tests of the external plugins
|
||||
, callPackage, beets
|
||||
|
||||
, enableAcousticbrainz ? true
|
||||
, enableAcoustid ? true
|
||||
, enableBadfiles ? true, flac ? null, mp3val ? null
|
||||
@ -77,6 +80,19 @@ let
|
||||
testShell = "${bashInteractive}/bin/bash --norc";
|
||||
completion = "${bash-completion}/share/bash-completion/bash_completion";
|
||||
|
||||
# This is a stripped down beets for testing of the external plugins.
|
||||
externalTestArgs.beets = (beets.override {
|
||||
enableAlternatives = false;
|
||||
enableCopyArtifacts = false;
|
||||
}).overrideAttrs (stdenv.lib.const {
|
||||
doInstallCheck = false;
|
||||
});
|
||||
|
||||
plugins = {
|
||||
alternatives = callPackage ./alternatives-plugin.nix externalTestArgs;
|
||||
copyartifacts = callPackage ./copyartifacts-plugin.nix externalTestArgs;
|
||||
};
|
||||
|
||||
in pythonPackages.buildPythonApplication rec {
|
||||
name = "beets-${version}";
|
||||
version = "1.4.5";
|
||||
@ -101,26 +117,22 @@ in pythonPackages.buildPythonApplication rec {
|
||||
pythonPackages.gst-python
|
||||
pythonPackages.pygobject3
|
||||
gobjectIntrospection
|
||||
] ++ optional enableAcoustid pythonPackages.pyacoustid
|
||||
] ++ optional enableAcoustid pythonPackages.pyacoustid
|
||||
++ optional (enableFetchart
|
||||
|| enableEmbyupdate
|
||||
|| enableKodiupdate
|
||||
|| enableAcousticbrainz)
|
||||
pythonPackages.requests
|
||||
++ optional enableConvert ffmpeg
|
||||
++ optional enableDiscogs pythonPackages.discogs_client
|
||||
++ optional enableGmusic pythonPackages.gmusicapi
|
||||
++ optional enableKeyfinder keyfinder-cli
|
||||
++ optional enableLastfm pythonPackages.pylast
|
||||
++ optional enableMpd pythonPackages.mpd2
|
||||
++ optional enableThumbnails pythonPackages.pyxdg
|
||||
++ optional enableWeb pythonPackages.flask
|
||||
++ optional enableAlternatives (import ./alternatives-plugin.nix {
|
||||
inherit stdenv pythonPackages fetchFromGitHub;
|
||||
})
|
||||
++ optional enableCopyArtifacts (import ./copyartifacts-plugin.nix {
|
||||
inherit stdenv pythonPackages fetchFromGitHub;
|
||||
});
|
||||
pythonPackages.requests
|
||||
++ optional enableConvert ffmpeg
|
||||
++ optional enableDiscogs pythonPackages.discogs_client
|
||||
++ optional enableGmusic pythonPackages.gmusicapi
|
||||
++ optional enableKeyfinder keyfinder-cli
|
||||
++ optional enableLastfm pythonPackages.pylast
|
||||
++ optional enableMpd pythonPackages.mpd2
|
||||
++ optional enableThumbnails pythonPackages.pyxdg
|
||||
++ optional enableWeb pythonPackages.flask
|
||||
++ optional enableAlternatives plugins.alternatives
|
||||
++ optional enableCopyArtifacts plugins.copyartifacts;
|
||||
|
||||
buildInputs = with pythonPackages; [
|
||||
beautifulsoup4
|
||||
|
Loading…
Reference in New Issue
Block a user