beets: modernize and disable failing test (#385592)

authored by Doron Behar and committed by GitHub b2af5ff2 4a7cb78c

+58 -19
+33 -7
pkgs/tools/audio/beets/common.nix
··· 1 1 { 2 2 lib, 3 + stdenv, 3 4 src, 4 5 version, 6 + fetchpatch, 5 7 bashInteractive, 6 8 diffPlugins, 7 9 gobject-introspection, 8 10 gst_all_1, 9 11 python3Packages, 10 12 sphinxHook, 13 + writableTmpDirAsHomeHook, 11 14 runtimeShell, 12 15 writeScript, 13 16 ··· 78 81 inherit src version; 79 82 pyproject = true; 80 83 81 - patches = extraPatches; 84 + patches = [ 85 + (fetchpatch { 86 + # Already on master. TODO: remove when updating to the next release 87 + # Issue: https://github.com/beetbox/beets/issues/5527 88 + # PR: https://github.com/beetbox/beets/pull/5650 89 + name = "fix-im-backend"; 90 + url = "https://github.com/beetbox/beets/commit/1f938674015ee71431fe9bd97c2214f58473efd2.patch"; 91 + hash = "sha256-koCYeiUhk1ifo6CptOSu3p7Nz0FFUeiuArTknM/tpVQ="; 92 + excludes = [ 93 + "docs/changelog.rst" 94 + ]; 95 + }) 96 + ] ++ extraPatches; 82 97 83 98 build-system = [ 84 99 python3Packages.poetry-core ··· 144 159 mock 145 160 rarfile 146 161 responses 162 + ] 163 + ++ [ 164 + writableTmpDirAsHomeHook 147 165 ] 148 166 ++ pluginWrapperBins; 149 167 150 168 __darwinAllowLocalNetworking = true; 151 169 152 - disabledTestPaths = disabledTestPaths ++ [ 153 - # touches network 154 - "test/plugins/test_aura.py" 155 - ]; 170 + disabledTestPaths = 171 + disabledTestPaths 172 + ++ [ 173 + # touches network 174 + "test/plugins/test_aura.py" 175 + ] 176 + ++ lib.optionals stdenv.hostPlatform.isDarwin [ 177 + # Flaky: several tests fail randomly with: 178 + # if not self._poll(timeout): 179 + # raise Empty 180 + # _queue.Empty 181 + "test/plugins/test_player.py" 182 + ]; 156 183 disabledTests = disabledTests ++ [ 157 184 # beets.ui.UserError: unknown command 'autobpm' 158 185 "test/plugins/test_autobpm.py::TestAutoBPMPlugin::test_import" ··· 170 197 | sort -u > plugins_available 171 198 ${diffPlugins (attrNames builtinPlugins) "plugins_available"} 172 199 173 - export BEETS_TEST_SHELL="${bashInteractive}/bin/bash --norc" 174 - export HOME="$(mktemp -d)" 200 + export BEETS_TEST_SHELL="${lib.getExe bashInteractive} --norc" 175 201 176 202 env EDITOR="${writeScript "beetconfig.sh" '' 177 203 #!${runtimeShell}
+1 -1
pkgs/tools/audio/beets/default.nix
··· 38 38 src = fetchFromGitHub { 39 39 owner = "beetbox"; 40 40 repo = "beets"; 41 - rev = "v${version}"; 41 + tag = "v${version}"; 42 42 hash = "sha256-jhwXRgUUQJgQ/PLwvY1UfHCJ9UC8DcdBpE/janao0RM="; 43 43 }; 44 44 };
+24 -11
pkgs/tools/audio/beets/plugins/alternatives.nix
··· 3 3 fetchFromGitHub, 4 4 beets, 5 5 python3Packages, 6 + writableTmpDirAsHomeHook, 6 7 }: 7 8 8 9 python3Packages.buildPythonApplication rec { 9 10 pname = "beets-alternatives"; 10 - version = "0.13.0"; 11 + version = "0.13.1"; 11 12 pyproject = true; 12 13 13 14 src = fetchFromGitHub { 14 15 repo = "beets-alternatives"; 15 16 owner = "geigerzaehler"; 16 - rev = "refs/tags/v${version}"; 17 - sha256 = "sha256-i67Bzdh84TuVwcgwo5SgHFp1W04KF3VA6cbrFz82je0="; 17 + tag = "v${version}"; 18 + hash = "sha256-+LvQC7hYtbJeWJiDEKtSFZaEtnuXZ+4mI75rrX9Sd64="; 18 19 }; 19 20 20 21 nativeBuildInputs = [ 21 22 beets 23 + ]; 24 + 25 + dependencies = [ 22 26 python3Packages.poetry-core 23 27 ]; 24 28 25 - nativeCheckInputs = with python3Packages; [ 26 - pytestCheckHook 27 - pytest-cov 28 - mock 29 - typeguard 29 + nativeCheckInputs = 30 + with python3Packages; 31 + [ 32 + pytestCheckHook 33 + pytest-cov-stub 34 + mock 35 + typeguard 36 + ] 37 + ++ [ 38 + writableTmpDirAsHomeHook 39 + ]; 40 + 41 + disabledTests = [ 42 + # ValueError: too many values to unpack (expected 2) 43 + # https://github.com/geigerzaehler/beets-alternatives/issues/122 44 + "test_embed_art" 30 45 ]; 31 - preCheck = '' 32 - export HOME=$(mktemp -d) 33 - ''; 34 46 35 47 meta = { 36 48 description = "Beets plugin to manage external files"; 37 49 homepage = "https://github.com/geigerzaehler/beets-alternatives"; 50 + changelog = "https://github.com/geigerzaehler/beets-alternatives/blob/v${version}/CHANGELOG.md"; 38 51 maintainers = with lib.maintainers; [ 39 52 aszlig 40 53 lovesegfault