nixpkgs/pkgs/tools/audio/beets/alternatives-plugin.nix

26 lines
740 B
Nix
Raw Normal View History

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 01:03:03 +01:00
{ stdenv, fetchFromGitHub, beets, pythonPackages }:
pythonPackages.buildPythonApplication rec {
pname = "beets-alternatives";
beets-alternatives: 0.8.2 -> 0.9.0 This introduces the following upstream changes: * The package is now on PyPI * Require at least beets v1.4.7 * Update album art in alternatives when it changes * Python 3 support (Python 2.7 continues to be supported) * Support the format aliases defined by the convert plugin ('wma' and 'vorbis' with current beets) * Bugfix: Explicitly write tags after encoding instead of relying on the encoder to do so * Bugfix: If the formats config option is modified, don't move files if the extension would change, but re-encode I updated this because I was pinged by @wisp3rwind about moving back to @geigerzaehler's repository at [1]. This is what @wisp3rwind wrote in the comment[2] (which was originally directed to @Profpatsch): (I hope you're the one to bug, or at least can ping someone else), I just noticed that you switched the NixOS package to my repository. Would you please switch it back to this repo soon-ish? The code here is better tested, and [3] is handled less elegantly on my fork since it requires changes to the configuration. The latter are undocumented, but whoever has bothered to take a look at the code might end up with (harmless) unused config entries. So in essence we're now back to the original upstream repository again, which I changed to @wisp3rwind's fork in 29e89248bfe74ca8d9d539c7ae441f because it fixed issues with Python 3. Stripping the long_description from setup.py also doesn't seem to be required anymore, but I didn't investigate why (might be because either our Python tooling now sets a default language or the README simply no longer has non-ASCII characters). [1]: https://github.com/geigerzaehler/beets-alternatives [2]: https://github.com/geigerzaehler/beets-alternatives/issues/23 [3]: https://github.com/geigerzaehler/beets-alternatives/pull/27 Signed-off-by: aszlig <aszlig@nix.build>
2018-11-29 03:53:39 +00:00
version = "0.9.0";
src = fetchFromGitHub {
repo = "beets-alternatives";
beets-alternatives: 0.8.2 -> 0.9.0 This introduces the following upstream changes: * The package is now on PyPI * Require at least beets v1.4.7 * Update album art in alternatives when it changes * Python 3 support (Python 2.7 continues to be supported) * Support the format aliases defined by the convert plugin ('wma' and 'vorbis' with current beets) * Bugfix: Explicitly write tags after encoding instead of relying on the encoder to do so * Bugfix: If the formats config option is modified, don't move files if the extension would change, but re-encode I updated this because I was pinged by @wisp3rwind about moving back to @geigerzaehler's repository at [1]. This is what @wisp3rwind wrote in the comment[2] (which was originally directed to @Profpatsch): (I hope you're the one to bug, or at least can ping someone else), I just noticed that you switched the NixOS package to my repository. Would you please switch it back to this repo soon-ish? The code here is better tested, and [3] is handled less elegantly on my fork since it requires changes to the configuration. The latter are undocumented, but whoever has bothered to take a look at the code might end up with (harmless) unused config entries. So in essence we're now back to the original upstream repository again, which I changed to @wisp3rwind's fork in 29e89248bfe74ca8d9d539c7ae441f because it fixed issues with Python 3. Stripping the long_description from setup.py also doesn't seem to be required anymore, but I didn't investigate why (might be because either our Python tooling now sets a default language or the README simply no longer has non-ASCII characters). [1]: https://github.com/geigerzaehler/beets-alternatives [2]: https://github.com/geigerzaehler/beets-alternatives/issues/23 [3]: https://github.com/geigerzaehler/beets-alternatives/pull/27 Signed-off-by: aszlig <aszlig@nix.build>
2018-11-29 03:53:39 +00:00
owner = "geigerzaehler";
# This is 0.8.2 with fixes against Beets 1.4.6 and Python 3 compatibility.
beets-alternatives: 0.8.2 -> 0.9.0 This introduces the following upstream changes: * The package is now on PyPI * Require at least beets v1.4.7 * Update album art in alternatives when it changes * Python 3 support (Python 2.7 continues to be supported) * Support the format aliases defined by the convert plugin ('wma' and 'vorbis' with current beets) * Bugfix: Explicitly write tags after encoding instead of relying on the encoder to do so * Bugfix: If the formats config option is modified, don't move files if the extension would change, but re-encode I updated this because I was pinged by @wisp3rwind about moving back to @geigerzaehler's repository at [1]. This is what @wisp3rwind wrote in the comment[2] (which was originally directed to @Profpatsch): (I hope you're the one to bug, or at least can ping someone else), I just noticed that you switched the NixOS package to my repository. Would you please switch it back to this repo soon-ish? The code here is better tested, and [3] is handled less elegantly on my fork since it requires changes to the configuration. The latter are undocumented, but whoever has bothered to take a look at the code might end up with (harmless) unused config entries. So in essence we're now back to the original upstream repository again, which I changed to @wisp3rwind's fork in 29e89248bfe74ca8d9d539c7ae441f because it fixed issues with Python 3. Stripping the long_description from setup.py also doesn't seem to be required anymore, but I didn't investigate why (might be because either our Python tooling now sets a default language or the README simply no longer has non-ASCII characters). [1]: https://github.com/geigerzaehler/beets-alternatives [2]: https://github.com/geigerzaehler/beets-alternatives/issues/23 [3]: https://github.com/geigerzaehler/beets-alternatives/pull/27 Signed-off-by: aszlig <aszlig@nix.build>
2018-11-29 03:53:39 +00:00
rev = "v${version}";
sha256 = "19160gwg5j6asy8mc21g2kf87mx4zs9x2gbk8q4r6330z4kpl5pm";
};
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 01:03:03 +01:00
nativeBuildInputs = [ beets pythonPackages.nose ];
checkPhase = "nosetests";
meta = {
description = "Beets plugin to manage external files";
homepage = "https://github.com/geigerzaehler/beets-alternatives";
maintainers = [ stdenv.lib.maintainers.aszlig ];
license = stdenv.lib.licenses.mit;
};
}