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@1a0c281da0be7251f414397960a83d60dc3a1520.
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
2017-09-02 02:03:03 +02:00
|
|
|
{ stdenv, fetchFromGitHub, beets, pythonPackages }:
|
2015-12-18 05:34:46 +01:00
|
|
|
|
2016-09-27 00:01:13 +02:00
|
|
|
pythonPackages.buildPythonApplication rec {
|
2015-12-18 05:34:46 +01:00
|
|
|
name = "beets-alternatives-${version}";
|
|
|
|
version = "0.8.2";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "beets-alternatives";
|
|
|
|
owner = "geigerzaehler";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "10za6h59pxa13y8i4amqhc6392csml0dl771lssv6b6a98kamsy7";
|
|
|
|
};
|
|
|
|
|
2018-01-31 04:39:21 +01:00
|
|
|
patches = [ ./alternatives-beets-1.4.6.patch ];
|
|
|
|
|
2015-12-18 05:34:46 +01:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e '/install_requires/,/\]/{/beets/d}' setup.py
|
2017-09-02 01:50:36 +02:00
|
|
|
sed -i -e '/test_suite/d' setup.py
|
2015-12-18 05:34:46 +01:00
|
|
|
'';
|
|
|
|
|
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@1a0c281da0be7251f414397960a83d60dc3a1520.
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
2017-09-02 02:03:03 +02:00
|
|
|
nativeBuildInputs = [ beets pythonPackages.nose ];
|
|
|
|
|
|
|
|
checkPhase = "nosetests";
|
|
|
|
|
2015-12-18 05:34:46 +01:00
|
|
|
propagatedBuildInputs = with pythonPackages; [ futures ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Beets plugin to manage external files";
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = https://github.com/geigerzaehler/beets-alternatives;
|
2015-12-18 05:34:46 +01:00
|
|
|
license = stdenv.lib.licenses.mit;
|
|
|
|
};
|
|
|
|
}
|