diff --git a/pkgs/tools/audio/beets/common.nix b/pkgs/tools/audio/beets/common.nix index 07db91eba091..ed070d8fb4d5 100644 --- a/pkgs/tools/audio/beets/common.nix +++ b/pkgs/tools/audio/beets/common.nix @@ -1,13 +1,16 @@ { lib, + stdenv, src, version, + fetchpatch, bashInteractive, diffPlugins, gobject-introspection, gst_all_1, python3Packages, sphinxHook, + writableTmpDirAsHomeHook, runtimeShell, writeScript, @@ -78,7 +81,19 @@ python3Packages.buildPythonApplication { inherit src version; pyproject = true; - patches = extraPatches; + patches = [ + (fetchpatch { + # Already on master. TODO: remove when updating to the next release + # Issue: https://github.com/beetbox/beets/issues/5527 + # PR: https://github.com/beetbox/beets/pull/5650 + name = "fix-im-backend"; + url = "https://github.com/beetbox/beets/commit/1f938674015ee71431fe9bd97c2214f58473efd2.patch"; + hash = "sha256-koCYeiUhk1ifo6CptOSu3p7Nz0FFUeiuArTknM/tpVQ="; + excludes = [ + "docs/changelog.rst" + ]; + }) + ] ++ extraPatches; build-system = [ python3Packages.poetry-core @@ -145,14 +160,26 @@ python3Packages.buildPythonApplication { rarfile responses ] + ++ [ + writableTmpDirAsHomeHook + ] ++ pluginWrapperBins; __darwinAllowLocalNetworking = true; - disabledTestPaths = disabledTestPaths ++ [ - # touches network - "test/plugins/test_aura.py" - ]; + disabledTestPaths = + disabledTestPaths + ++ [ + # touches network + "test/plugins/test_aura.py" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Flaky: several tests fail randomly with: + # if not self._poll(timeout): + # raise Empty + # _queue.Empty + "test/plugins/test_player.py" + ]; disabledTests = disabledTests ++ [ # beets.ui.UserError: unknown command 'autobpm' "test/plugins/test_autobpm.py::TestAutoBPMPlugin::test_import" @@ -170,8 +197,7 @@ python3Packages.buildPythonApplication { | sort -u > plugins_available ${diffPlugins (attrNames builtinPlugins) "plugins_available"} - export BEETS_TEST_SHELL="${bashInteractive}/bin/bash --norc" - export HOME="$(mktemp -d)" + export BEETS_TEST_SHELL="${lib.getExe bashInteractive} --norc" env EDITOR="${writeScript "beetconfig.sh" '' #!${runtimeShell} diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index 74abd34e13b7..a9cd1a9bdfb9 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -38,7 +38,7 @@ lib.makeExtensible (self: { src = fetchFromGitHub { owner = "beetbox"; repo = "beets"; - rev = "v${version}"; + tag = "v${version}"; hash = "sha256-jhwXRgUUQJgQ/PLwvY1UfHCJ9UC8DcdBpE/janao0RM="; }; }; diff --git a/pkgs/tools/audio/beets/plugins/alternatives.nix b/pkgs/tools/audio/beets/plugins/alternatives.nix index d2520fcaca63..4df52d61d45c 100644 --- a/pkgs/tools/audio/beets/plugins/alternatives.nix +++ b/pkgs/tools/audio/beets/plugins/alternatives.nix @@ -3,38 +3,51 @@ fetchFromGitHub, beets, python3Packages, + writableTmpDirAsHomeHook, }: python3Packages.buildPythonApplication rec { pname = "beets-alternatives"; - version = "0.13.0"; + version = "0.13.1"; pyproject = true; src = fetchFromGitHub { repo = "beets-alternatives"; owner = "geigerzaehler"; - rev = "refs/tags/v${version}"; - sha256 = "sha256-i67Bzdh84TuVwcgwo5SgHFp1W04KF3VA6cbrFz82je0="; + tag = "v${version}"; + hash = "sha256-+LvQC7hYtbJeWJiDEKtSFZaEtnuXZ+4mI75rrX9Sd64="; }; nativeBuildInputs = [ beets + ]; + + dependencies = [ python3Packages.poetry-core ]; - nativeCheckInputs = with python3Packages; [ - pytestCheckHook - pytest-cov - mock - typeguard + nativeCheckInputs = + with python3Packages; + [ + pytestCheckHook + pytest-cov-stub + mock + typeguard + ] + ++ [ + writableTmpDirAsHomeHook + ]; + + disabledTests = [ + # ValueError: too many values to unpack (expected 2) + # https://github.com/geigerzaehler/beets-alternatives/issues/122 + "test_embed_art" ]; - preCheck = '' - export HOME=$(mktemp -d) - ''; meta = { description = "Beets plugin to manage external files"; homepage = "https://github.com/geigerzaehler/beets-alternatives"; + changelog = "https://github.com/geigerzaehler/beets-alternatives/blob/v${version}/CHANGELOG.md"; maintainers = with lib.maintainers; [ aszlig lovesegfault