beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.71k stars 1.81k forks source link

bs1770gain 0.7.0 compatibility #3740

Closed doronbehar closed 4 years ago

doronbehar commented 4 years ago

Problem

Our distro (NixOS) would like to update bs1770gain to version 0.7.0 (PR), but that would break beets' users' replaygain plugin, as beets' tests indicate that bs1770gain's API has changed between 0.5.2 -> 0.7.0:

======================================================================
ERROR: test_cli_saves_album_gain_to_file (test.test_replaygain.ReplayGainLdnsCliTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/source/test/test_replaygain.py", line 137, in test_cli_saves_album_gain_to_file
    self.assertEqual(max(peaks), min(peaks))
TypeError: '>' not supported between instances of 'NoneType' and 'NoneType'
-------------------- >> begin captured logging << --------------------
beets: DEBUG: Sending event: database_change
beets: DEBUG: Sending event: database_change
beets: DEBUG: Sending event: item_copied
beets: DEBUG: Sending event: database_change
beets: DEBUG: Sending event: database_change
beets: DEBUG: Sending event: database_change
beets: DEBUG: Sending event: database_change
beets: DEBUG: Sending event: item_copied
beets: DEBUG: Sending event: database_change
beets: DEBUG: Sending event: database_change
beets: DEBUG: Sending event: database_change
beets: DEBUG: Sending event: database_change
beets: DEBUG: Sending event: database_change
beets: DEBUG: Sending event: database_change
beets: DEBUG: Sending event: write
beets: DEBUG: Sending event: after_write
beets: DEBUG: Sending event: database_change
beets: DEBUG: Sending event: write
beets: DEBUG: Sending event: after_write
beets: DEBUG: Sending event: database_change
beets: DEBUG: no user configuration found at /build/tmpw3ynrjoy/config.yaml
beets: DEBUG: data directory: /build/tmpw3ynrjoy
beets: DEBUG: plugin paths:
beets: DEBUG: Sending event: pluginload
beets.replaygain: INFO: replaygain: analyzing the album artist - älbum
beets.replaygain: DEBUG: replaygain: executing /nix/store/gz6gqn3cs9fzdppk51vix9cpj43bzwa4-bs1770gain-0.
7.0/bin/bs1770gain --replaygain --xml -p /build/tmpw3ynrjoy/libdir/the artist/älbum/02 tïtle 0.mp3 /buil
d/tmpw3ynrjoy/libdir/the artist/älbum/02 tïtle 1.mp3
beets.replaygain: DEBUG: replaygain: analysis finished: <!-- scanning 2 -->
<!-- analyzing ... -->
<bs1770gain norm="-18.00">
  <track total="2" number="1" file="02 tïtle 0.mp3">
    <integrated dbfs="-70.00" db="52.00"/>
    <sample-peak dbfs="-72.28" amplitude="0.00"/>
  </track>
  <track total="2" number="2" file="02 tïtle 1.mp3">
    <integrated dbfs="-70.00" db="52.00"/>
    <sample-peak dbfs="-72.28" amplitude="0.00"/>
  </track>
  <integrated dbfs="-70.00" db="52.00"/>
  <sample-peak dbfs="-72.28" amplitude="0.00"/>
</bs1770gain>
<!-- done. -->

beets.replaygain: INFO: replaygain: ReplayGain error: The bs1770gain tool produced malformed XML. Using
version >=0.4.10 may solve this problem.
beets: DEBUG: Sending event: cli_exit
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_cli_saves_track_gain (test.test_replaygain.ReplayGainLdnsCliTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/source/beetsplug/replaygain.py", line 55, in call
    return command_output(args)
  File "/build/source/beets/util/__init__.py", line 829, in command_output
    raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command '/nix/store/gz6gqn3cs9fzdppk51vix9cpj43bzwa4-bs1770gain-0.7.0/bin
/bs1770gain --replaygain' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/source/beetsplug/replaygain.py", line 866, in __init__
    self.backend_instance = self.backends[backend_name](
  File "/build/source/beetsplug/replaygain.py", line 109, in __init__
    call([cmd, self.method])
  File "/build/source/beetsplug/replaygain.py", line 57, in call
    raise ReplayGainError(
beetsplug.replaygain.ReplayGainError: /nix/store/gz6gqn3cs9fzdppk51vix9cpj43bzwa4-bs1770gain-0.7.0/bin/b
s1770gain exited with status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/source/test/test_replaygain.py", line 64, in setUp
    self.load_plugins('replaygain')
  File "/build/source/test/helper.py", line 224, in load_plugins
    beets.plugins.find_plugins()
  File "/build/source/beets/plugins.py", line 307, in find_plugins
    _instances[cls] = cls()
  File "/build/source/beetsplug/replaygain.py", line 870, in __init__
    raise ui.UserError(
beets.ui.UserError: replaygain initialization failed: /nix/store/gz6gqn3cs9fzdppk51vix9cpj43bzwa4-bs1770
gain-0.7.0/bin/bs1770gain exited with status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/source/test/test_replaygain.py", line 77, in setUp
    six.reraise(exc_info[1], None, exc_info[2])
  File "/nix/store/d1ldmhm40lmr2z17l6mzklhvpdvb2gqs-python3.8-six-1.15.0/lib/python3.8/site-packages/six
.py", line 700, in reraise
    value = tp()
TypeError: 'UserError' object is not callable

======================================================================
ERROR: test_cli_skips_calculated_tracks (test.test_replaygain.ReplayGainLdnsCliTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/source/beetsplug/replaygain.py", line 55, in call
    return command_output(args)
  File "/build/source/beets/util/__init__.py", line 829, in command_output
    raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command '/nix/store/gz6gqn3cs9fzdppk51vix9cpj43bzwa4-bs1770gain-0.7.0/bin
/bs1770gain --replaygain' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/source/beetsplug/replaygain.py", line 866, in __init__
    self.backend_instance = self.backends[backend_name](
  File "/build/source/beetsplug/replaygain.py", line 109, in __init__
    call([cmd, self.method])
  File "/build/source/beetsplug/replaygain.py", line 57, in call
    raise ReplayGainError(
beetsplug.replaygain.ReplayGainError: /nix/store/gz6gqn3cs9fzdppk51vix9cpj43bzwa4-bs1770gain-0.7.0/bin/b
s1770gain exited with status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/source/test/test_replaygain.py", line 64, in setUp
    self.load_plugins('replaygain')
  File "/build/source/test/helper.py", line 224, in load_plugins
    beets.plugins.find_plugins()
  File "/build/source/beets/plugins.py", line 307, in find_plugins
    _instances[cls] = cls()
  File "/build/source/beetsplug/replaygain.py", line 870, in __init__
    raise ui.UserError(
beets.ui.UserError: replaygain initialization failed: /nix/store/gz6gqn3cs9fzdppk51vix9cpj43bzwa4-bs1770
gain-0.7.0/bin/bs1770gain exited with status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/source/test/test_replaygain.py", line 77, in setUp
    six.reraise(exc_info[1], None, exc_info[2])
  File "/nix/store/d1ldmhm40lmr2z17l6mzklhvpdvb2gqs-python3.8-six-1.15.0/lib/python3.8/site-packages/six
.py", line 700, in reraise
    value = tp()
TypeError: 'UserError' object is not callable

----------------------------------------------------------------------

Setup

My configuration (output of beet config) is: irrelevant

sampsyo commented 4 years ago

Hello! Is there any chance this is addressed in #3480? (In which case all we need is a new release…)

doronbehar commented 4 years ago

It seems so. I'm having a bit of (NixOS specific) issues testing the latest master, and that PR's commit is rejected when applied on 1.4.9. I'll reopen if I'll encounter issues with 0.7.0.

I sure can't wait for the 1.5.0 though :).