From 1ced61d1ecacc05b724c5707f7d193f293d0d9dc Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 8 May 2025 10:49:03 +0300 Subject: [PATCH 1/7] beets: 2.2.0 -> 2.3.0 https://github.com/beetbox/beets/releases/tag/v2.3.0 --- pkgs/tools/audio/beets/default.nix | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index 750626191970..75e57999059f 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -4,7 +4,6 @@ config, fetchFromGitHub, python3Packages, - fetchpatch, }: /* ** To customize the enabled beets plugins, use the pluginOverrides input to the @@ -21,24 +20,8 @@ */ let extraPatches = [ - (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" - ]; - }) # Bash completion fix for Nix ./patches/bash-completion-always-print.patch - # Remove after next release. - (fetchpatch { - url = "https://github.com/beetbox/beets/commit/bcc79a5b09225050ce7c88f63dfa56f49f8782a8.patch?full_index=1"; - hash = "sha256-Y2Q5Co3UlDGKuzfxUvdUY3rSMNpsBoDW03ZWZOfzp3Y="; - }) ]; in lib.makeExtensible ( @@ -48,12 +31,12 @@ lib.makeExtensible ( beets-stable = callPackage ./common.nix rec { inherit python3Packages extraPatches; - version = "2.2.0"; + version = "2.3.0"; src = fetchFromGitHub { owner = "beetbox"; repo = "beets"; tag = "v${version}"; - hash = "sha256-jhwXRgUUQJgQ/PLwvY1UfHCJ9UC8DcdBpE/janao0RM="; + hash = "sha256-mH3m2O+q5Ys9DJD3ulmhViyf/VPEpHevjmNerVe327s="; }; }; From b2f01568422aaacd1582923421d43550c79c5211 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 8 May 2025 10:49:44 +0300 Subject: [PATCH 2/7] beets-unstable: 2.2.0-unstable-2025-03-12 -> 2.3.0 --- pkgs/tools/audio/beets/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index 75e57999059f..247c3a4a13eb 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -44,12 +44,12 @@ lib.makeExtensible ( beets-unstable = callPackage ./common.nix { inherit python3Packages; - version = "2.2.0-unstable-2025-03-12"; + version = "2.3.0"; src = fetchFromGitHub { owner = "beetbox"; repo = "beets"; - rev = "670a3bcd17a46883c71cf07dd313fcd0dff4be9d"; - hash = "sha256-hSY7FhpPL4poOY1/gqk7oLNgQ7KA/MJqx50xOLIP0QA="; + rev = "250b0da900c095a09bedc1a0717381010c01a3c6"; + hash = "sha256-mH3m2O+q5Ys9DJD3ulmhViyf/VPEpHevjmNerVe327s="; }; }; From b66fc213adad6b7e250b95a148c1d93599183791 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 12 May 2025 15:27:29 +0300 Subject: [PATCH 3/7] beetsPackages.alternatives: 0.13.2 -> 0.13.3 Diff: https://github.com/geigerzaehler/beets-alternatives/compare/refs/tags/v0.13.2...refs/tags/v0.13.3 Changelog: https://github.com/geigerzaehler/beets-alternatives/blob/v0.13.3/CHANGELOG.md --- pkgs/tools/audio/beets/plugins/alternatives.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/audio/beets/plugins/alternatives.nix b/pkgs/tools/audio/beets/plugins/alternatives.nix index 27b7011c3109..15599ce56c7a 100644 --- a/pkgs/tools/audio/beets/plugins/alternatives.nix +++ b/pkgs/tools/audio/beets/plugins/alternatives.nix @@ -8,14 +8,14 @@ python3Packages.buildPythonApplication rec { pname = "beets-alternatives"; - version = "0.13.2"; + version = "0.13.3"; pyproject = true; src = fetchFromGitHub { repo = "beets-alternatives"; owner = "geigerzaehler"; tag = "v${version}"; - hash = "sha256-OoQsP+QVIOnSA4oy1a8JJ3VeCUS+GR8sPPOysvmRMqI="; + hash = "sha256-j56AzbpZFACXy5KqafE8PCC+zM6pXrxr/rWy9UjZPQg="; }; nativeBuildInputs = [ From 62f48c9c79680115b5a82a3e51ff56ba8106ad97 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 12 May 2025 15:50:12 +0300 Subject: [PATCH 4/7] beetsPackages.audible: Put beets in nativeBuildInputs --- pkgs/tools/audio/beets/plugins/audible.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/audio/beets/plugins/audible.nix b/pkgs/tools/audio/beets/plugins/audible.nix index f1aee4179ea9..7e090bf2358f 100644 --- a/pkgs/tools/audio/beets/plugins/audible.nix +++ b/pkgs/tools/audio/beets/plugins/audible.nix @@ -17,19 +17,21 @@ python3Packages.buildPythonApplication rec { hash = "sha256-Sds16h+W9t7N755ADPXXDi+SxwouBMxP9ApUqaXedqY="; }; + nativeBuildInputs = [ + beets + ]; + pythonRelaxDeps = true; build-system = with python3Packages; [ hatchling ]; - dependencies = - [ beets ] - ++ (with python3Packages; [ - markdownify - natsort - tldextract - ]); + dependencies = with python3Packages; [ + markdownify + natsort + tldextract + ]; passthru = { updateScript = nix-update-script { }; From 1475adcd67a3b3a06babca6bb047234a88f2bb80 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 12 May 2025 15:54:13 +0300 Subject: [PATCH 5/7] beetsPackages.copyartifacts: Put beets in nativeBuildInputs Has no real difference on the results, but it makes a bit more sense to not remove beets from the setup.py file, and depend on it only via nativeBuildInputs. This is also consistent with other plugins, see: https://github.com/NixOS/nixpkgs/pull/257943#discussion_r2083635799 --- pkgs/tools/audio/beets/plugins/copyartifacts.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/audio/beets/plugins/copyartifacts.nix b/pkgs/tools/audio/beets/plugins/copyartifacts.nix index 46bef54e213e..cdd55aa391d2 100644 --- a/pkgs/tools/audio/beets/plugins/copyartifacts.nix +++ b/pkgs/tools/audio/beets/plugins/copyartifacts.nix @@ -19,7 +19,6 @@ python3Packages.buildPythonApplication rec { }; 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 @@ -28,13 +27,15 @@ python3Packages.buildPythonApplication rec { sed -i -e 's/util\.py3_path/os.fsdecode/g' tests/_common.py ''; + nativeBuildInputs = [ + beets + ]; build-system = with python3Packages; [ setuptools ]; dependencies = with python3Packages; [ six ]; nativeCheckInputs = [ python3Packages.pytestCheckHook - beets writableTmpDirAsHomeHook ]; From b42b3495a0d89198a71221621e3b4492a186229c Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 12 May 2025 15:57:22 +0300 Subject: [PATCH 6/7] beetsPackages.copyartifacts: Small consistency empty lines --- pkgs/tools/audio/beets/plugins/copyartifacts.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/audio/beets/plugins/copyartifacts.nix b/pkgs/tools/audio/beets/plugins/copyartifacts.nix index cdd55aa391d2..449e8e05c0ea 100644 --- a/pkgs/tools/audio/beets/plugins/copyartifacts.nix +++ b/pkgs/tools/audio/beets/plugins/copyartifacts.nix @@ -30,9 +30,14 @@ python3Packages.buildPythonApplication rec { nativeBuildInputs = [ beets ]; - build-system = with python3Packages; [ setuptools ]; - dependencies = with python3Packages; [ six ]; + build-system = with python3Packages; [ + setuptools + ]; + + dependencies = with python3Packages; [ + six + ]; nativeCheckInputs = [ python3Packages.pytestCheckHook From 592a9e90dae648ce67120a2aa403f76757b7901d Mon Sep 17 00:00:00 2001 From: dansbandit <4530687+dansbandit@users.noreply.github.com> Date: Mon, 12 May 2025 16:00:01 +0300 Subject: [PATCH 7/7] beetsPackages.filetote: init at 1.0.1 Co-Authored-By: Doron Behar --- pkgs/tools/audio/beets/default.nix | 1 + pkgs/tools/audio/beets/plugins/filetote.nix | 83 +++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 pkgs/tools/audio/beets/plugins/filetote.nix diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index 247c3a4a13eb..a0ff569b4179 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -56,6 +56,7 @@ lib.makeExtensible ( alternatives = callPackage ./plugins/alternatives.nix { beets = self.beets-minimal; }; audible = callPackage ./plugins/audible.nix { beets = self.beets-minimal; }; copyartifacts = callPackage ./plugins/copyartifacts.nix { beets = self.beets-minimal; }; + filetote = callPackage ./plugins/filetote.nix { beets = self.beets-minimal; }; } // lib.optionalAttrs config.allowAliases { extrafiles = throw "extrafiles is unmaintained since 2020 and broken since beets 2.0.0"; diff --git a/pkgs/tools/audio/beets/plugins/filetote.nix b/pkgs/tools/audio/beets/plugins/filetote.nix new file mode 100644 index 000000000000..34a6af769431 --- /dev/null +++ b/pkgs/tools/audio/beets/plugins/filetote.nix @@ -0,0 +1,83 @@ +{ + lib, + fetchFromGitHub, + python3Packages, + beets, + beetsPackages, + writableTmpDirAsHomeHook, +}: + +python3Packages.buildPythonApplication rec { + pname = "beets-filetote"; + version = "1.0.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "gtronset"; + repo = "beets-filetote"; + tag = "v${version}"; + hash = "sha256-LTJwZI/kQc+Iv0y8jAi5Xdh4wLEwbTA9hV76ndQsQzU="; + }; + + postPatch = '' + substituteInPlace pyproject.toml --replace-fail "poetry-core<2.0.0" "poetry-core" + ''; + + nativeBuildInputs = [ + beets + ]; + + build-system = [ python3Packages.poetry-core ]; + + dependencies = with python3Packages; [ + mediafile + reflink + toml + typeguard + ]; + + optional-dependencies = { + lint = with python3Packages; [ + black + check-manifest + flake8 + flake8-bugbear + flake8-bugbear-pyi + isort + mypy + pylint + typing_extensions + ]; + test = with python3Packages; [ + beetsPackages.audible + mediafile + pytest + reflink + toml + typeguard + ]; + dev = optional-dependencies.lint ++ optional-dependencies.test ++ [ python3Packages.tox ]; + }; + + pytestFlagsArray = [ "-r fEs" ]; + + disabledTestPaths = [ + "tests/test_cli_operation.py" + "tests/test_pruning.py" + "tests/test_version.py" + ]; + + nativeCheckInputs = [ + python3Packages.pytestCheckHook + writableTmpDirAsHomeHook + ] ++ optional-dependencies.test; + + meta = with lib; { + description = "Beets plugin to move non-music files during the import process"; + homepage = "https://github.com/gtronset/beets-filetote"; + changelog = "https://github.com/gtronset/beets-filetote/blob/${src.rev}/CHANGELOG.md"; + maintainers = with maintainers; [ dansbandit ]; + license = licenses.mit; + inherit (beets.meta) platforms; + }; +}