Unverified Commit 8a46e631 authored by Doron Behar's avatar Doron Behar Committed by GitHub
Browse files

Merge pull request #318334 from doronbehar/pkg/beets

beets-unstable: unstable-2024-03-16 -> 2.0.0-unstable-2024-05-25
parents 7bc28690 3bfa4f50
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
{ stdenv
, aacgain
, essentia-extractor
, ffmpeg
, flac
, imagemagick
@@ -16,6 +15,7 @@
    deprecated = true;
    testPaths = [ ];
  };

  acousticbrainz.propagatedBuildInputs = [ python3Packages.requests ];
  albumtypes = { };
  aura = {
@@ -87,7 +87,7 @@
  mbcollection.testPaths = [ ];
  mbsubmit = { };
  mbsync = { };
  metasync = { };
  metasync.testPaths = [ ];
  missing.testPaths = [ ];
  mpdstats.propagatedBuildInputs = [ python3Packages.mpd2 ];
  mpdupdate = {
@@ -119,12 +119,10 @@
    propagatedBuildInputs = with python3Packages; [ pillow pyxdg ];
    wrapperBins = [ imagemagick ];
  };
  types.testPaths = [ "test/test_types_plugin.py" ];
  types.testPaths = [ "test/plugins/test_types_plugin.py" ];
  unimported.testPaths = [ ];
  web.propagatedBuildInputs = [ python3Packages.flask ];
  zero = { };
  # NOTE: Condition can be removed once stable beets updates
} // lib.optionalAttrs ((lib.versions.majorMinor version) != "1.6") {
  limit = { };
  substitute = {
    testPaths = [ ];
+2 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ python3Packages.buildPythonApplication {
  nativeBuildInputs = [
    gobject-introspection
    sphinxHook
    python3Packages.pydata-sphinx-theme
  ] ++ extraNativeBuildInputs;

  buildInputs = [
@@ -119,6 +120,7 @@ python3Packages.buildPythonApplication {

  nativeCheckInputs = with python3Packages; [
    pytestCheckHook
    pytest-cov
    mock
    rarfile
    responses
+8 −61
Original line number Diff line number Diff line
@@ -18,66 +18,23 @@
**   alternatives = { enable = true; propagatedBuildInputs = [ beetsPackages.alternatives ]; };
** }; }
*/
let
  legacyMediafilePython3Packages = python3Packages.override {
    overrides = self: super: {
      mediafile = super.mediafile.overridePythonAttrs (oldAttrs: rec {
        version = "0.10.1";
        format = "pyproject";
        src = fetchPypi {
          pname = "mediafile";
          inherit version;
          hash = "sha256-kpZCoX7lAjuQhiIc6AzcLFHQYCGokNRDOwvVvTLysp8=";
        };
      });
    };
  };
in lib.makeExtensible (self: {
lib.makeExtensible (self: {
  beets = self.beets-stable;

  beets-stable = callPackage ./common.nix rec {
    python3Packages = legacyMediafilePython3Packages;
    inherit python3Packages;
    # NOTE: ./builtin-plugins.nix and ./common.nix can have some conditionals
    # be removed when stable version updates
    version = "1.6.0";
    version = "2.0.0";
    src = fetchFromGitHub {
      owner = "beetbox";
      repo = "beets";
      rev = "v${version}";
      hash = "sha256-fT+rCJJQR7bdfAcmeFRaknmh4ZOP4RCx8MXpq7/D8tM=";
      hash = "sha256-6pmImyopy0zFBDYoqDyWcBv61FK1kGsZwW2+7fzAnq8=";
    };
    extraPatches = [
      # Bash completion fix for Nix
      ./patches/bash-completion-always-print.patch

      # Fix unidecode>=1.3.5 compat
      (fetchpatch {
        url = "https://github.com/beetbox/beets/commit/5ae1e0f3c8d3a450cb39f7933aa49bb78c2bc0d9.patch";
        hash = "sha256-gqkrE+U1j3tt1qPRJufTGS/GftaSw/gweXunO/mCVG8=";
      })

      # Fix embedart with ImageMagick 7.1.1-12
      # https://github.com/beetbox/beets/pull/4839
      # The upstream patch does not apply on 1.6.0, as the related code has been refactored since
      ./patches/fix-embedart-imagick-7.1.1-12.patch
      # Pillow 10 compatibility fix, a backport of
      # https://github.com/beetbox/beets/pull/4868, which doesn't apply now
      ./patches/fix-pillow10-compat.patch

      # Sphinx 6 compatibility fix.
      (fetchpatch {
        url = "https://github.com/beetbox/beets/commit/2106f471affd1dab35b4b26187b9c74d034528c5.patch";
        hash = "sha256-V/886dYJW/O55VqU8sd+x/URIFcKhP6j5sUhTGMoxL8=";
      })
    ];
    disabledTests = [
      # This issue is present on this version alone, and can be removed on the
      # next stable version version bump. Since this is fixed in branch master,
      # we don't have a bug ticket open for this. As of writing, it also seems
      # hard to find a patch that can be backported to v1.6.0 that would fix
      # the failure, as the master branch has gone through too many changes
      # now.
      "test_get_single_item_by_path"
    ];
  };

@@ -85,26 +42,16 @@ in lib.makeExtensible (self: {

  beets-unstable = callPackage ./common.nix {
    inherit python3Packages;
    version = "unstable-2024-03-16";
    version = "2.0.0-unstable-2024-05-25";
    src = fetchFromGitHub {
      owner = "beetbox";
      repo = "beets";
      rev = "b09806e0df8f01b9155017d3693764ae7beedcd5";
      hash = "sha256-jE6nZLOEFufqclT6p1zK7dW+vt69q2ulaRsUldL7cSQ=";
      rev = "2130404217684f22f36de00663428602b3f96d84";
      hash = "sha256-trqF6YVBcv+i5H4Ez3PKnRQ6mV2Ly/cw3UJC7pl19og=";
    };
    extraPatches = [
      # Bash completion fix for Nix
      ./patches/unstable-bash-completion-always-print.patch
    ];
    pluginOverrides = {
      # unstable has new plugins, so we register them here.
      limit = { builtin = true; };
      substitute = { builtin = true; };
      advancedrewrite = { builtin = true; };
      autobpm = { builtin = true; };
    };
    extraNativeBuildInputs = [
      python3Packages.pydata-sphinx-theme
      ./patches/bash-completion-always-print.patch
    ];
  };

+23 −22
Original line number Diff line number Diff line
diff --git i/beets/ui/commands.py w/beets/ui/commands.py
index 3a337401..d08a6763 100755
index ad4f7821..5077191d 100755
--- i/beets/ui/commands.py
+++ w/beets/ui/commands.py
@@ -1759,21 +1759,6 @@ default_commands.append(config_cmd)
@@ -2381,22 +2381,6 @@ default_commands.append(config_cmd)
 def print_completion(*args):
     for line in completion_script(default_commands + plugins.commands()):
         print_(line, end='')
-    if not any(map(os.path.isfile, BASH_COMPLETION_PATHS)):
-        log.warning('Warning: Unable to find the bash-completion package. '
-                    'Command line completion might not work.')
         print_(line, end="")
-    if not any(os.path.isfile(syspath(p)) for p in BASH_COMPLETION_PATHS):
-        log.warning(
-            "Warning: Unable to find the bash-completion package. "
-            "Command line completion might not work."
-        )
-
-
-BASH_COMPLETION_PATHS = map(syspath, [
-    '/etc/bash_completion',
-    '/usr/share/bash-completion/bash_completion',
-    '/usr/local/share/bash-completion/bash_completion',
-BASH_COMPLETION_PATHS = [
-    b"/etc/bash_completion",
-    b"/usr/share/bash-completion/bash_completion",
-    b"/usr/local/share/bash-completion/bash_completion",
-    # SmartOS
-    '/opt/local/share/bash-completion/bash_completion',
-    b"/opt/local/share/bash-completion/bash_completion",
-    # Homebrew (before bash-completion2)
-    '/usr/local/etc/bash_completion',
-])
-
-    b"/usr/local/etc/bash_completion",
-]
 
 
 def completion_script(commands):
     """Yield the full completion shell script as strings.
diff --git i/test/test_ui.py w/test/test_ui.py
index 9804b0a1..c3b53243 100644
index cae86148..faf266a8 100644
--- i/test/test_ui.py
+++ w/test/test_ui.py
@@ -1229,12 +1229,7 @@ class CompletionTest(_common.TestCase, TestHelper):
                                   stdout=subprocess.PIPE, env=env)
@@ -1434,12 +1434,7 @@ class CompletionTest(_common.TestCase, TestHelper):
         )
 
         # Load bash_completion library.
-        for path in commands.BASH_COMPLETION_PATHS:
-            if os.path.exists(util.syspath(path)):
-            if os.path.exists(syspath(path)):
-                bash_completion = path
-                break
-        else:
-            self.skipTest('bash-completion script not found')
+        self.skipTest('bash-completion script not found')
-            self.skipTest("bash-completion script not found")
+        self.skipTest("bash-completion script not found")
         try:
             with open(util.syspath(bash_completion), 'rb') as f:
             with open(util.syspath(bash_completion), "rb") as f:
                 tester.stdin.writelines(f)
+0 −13
Original line number Diff line number Diff line
diff --git a/beets/art.py b/beets/art.py
index 13d5dfbd..ac1d2fd8 100644
--- a/beets/art.py
+++ b/beets/art.py
@@ -132,7 +132,7 @@ def check_art_similarity(log, item, imagepath, compare_threshold):
             convert_cmd = ['convert', syspath(imagepath, prefix=False),
                            syspath(art, prefix=False),
                            '-colorspace', 'gray', 'MIFF:-']
-            compare_cmd = ['compare', '-metric', 'PHASH', '-', 'null:']
+            compare_cmd = ['compare', '-define', 'phash:colorspaces=sRGB,HCLp', '-metric', 'PHASH', '-', 'null:']
             log.debug('comparing images with pipeline {} | {}',
                       convert_cmd, compare_cmd)
             convert_proc = subprocess.Popen(
Loading