about summary refs log tree commit diff
path: root/pkgs/development/python-modules/mutagen/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/mutagen/default.nix')
-rw-r--r--pkgs/development/python-modules/mutagen/default.nix65
1 files changed, 51 insertions, 14 deletions
diff --git a/pkgs/development/python-modules/mutagen/default.nix b/pkgs/development/python-modules/mutagen/default.nix
index 33fc3c02daeba..6308b6fceb6f6 100644
--- a/pkgs/development/python-modules/mutagen/default.nix
+++ b/pkgs/development/python-modules/mutagen/default.nix
@@ -1,37 +1,74 @@
 { lib
 , buildPythonPackage
+, pythonOlder
 , fetchPypi
-, isPy27
-, flake8
+
+# docs
+, python
+, sphinx
+, sphinx_rtd_theme
+
+# tests
 , hypothesis
-, pycodestyle
-, pyflakes
-, pytest
-, setuptools
-, pkgs
+, pytestCheckHook
 }:
 
 buildPythonPackage rec {
   pname = "mutagen";
   version = "1.45.1";
-  disabled = isPy27; # abandoned
+  format = "pyproject";
+
+  disabled = pythonOlder "3.6";
 
   src = fetchPypi {
     inherit pname version;
     sha256 = "6397602efb3c2d7baebd2166ed85731ae1c1d475abca22090b7141ff5034b3e1";
   };
 
-  propagatedBuildInputs = [ setuptools ];
+  outputs = [
+    "doc"
+    "out"
+  ];
+
+  nativeBuildInputs = [
+    sphinx
+    sphinx_rtd_theme
+  ];
+
+  postInstall = ''
+    ${python.interpreter} setup.py build_sphinx --build-dir=$doc
+  '';
+
   checkInputs = [
-    pkgs.faad2 pkgs.flac pkgs.vorbis-tools pkgs.liboggz
-    pkgs.glibcLocales pycodestyle pyflakes pytest hypothesis flake8
+    hypothesis
+    pytestCheckHook
+  ];
+
+  disabledTests = [
+    # Hypothesis produces unreliable results: Falsified on the first call but did not on a subsequent one
+    "test_test_fileobj_save"
+  ];
+
+  disabledTestPaths = [
+    # we are not interested in code quality measurements
+    "tests/quality/test_flake8.py"
   ];
-  LC_ALL = "en_US.UTF-8";
 
   meta = with lib; {
-    description = "Python multimedia tagging library";
+    description = "Python module for handling audio metadata";
+    longDescription = ''
+      Mutagen is a Python module to handle audio metadata. It supports
+      ASF, FLAC, MP4, Monkey's Audio, MP3, Musepack, Ogg Opus, Ogg FLAC,
+      Ogg Speex, Ogg Theora, Ogg Vorbis, True Audio, WavPack, OptimFROG,
+      and AIFF audio files. All versions of ID3v2 are supported, and all
+      standard ID3v2.4 frames are parsed. It can read Xing headers to
+      accurately calculate the bitrate and length of MP3s. ID3 and APEv2
+      tags can be edited regardless of audio format. It can also
+      manipulate Ogg streams on an individual packet/page level.
+    '';
     homepage = "https://mutagen.readthedocs.io";
-    license = licenses.lgpl2Plus;
+    changelog = "https://mutagen.readthedocs.io/en/latest/changelog.html#release-${lib.replaceStrings [ "." ] [ "-" ] version}";
+    license = licenses.gpl2Plus;
     platforms = platforms.all;
   };
 }