From ec7062492f88984017da132aa28167d0a5d3a456 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 25 Dec 2021 20:38:14 +0100 Subject: [PATCH] python3Packages.pydub: clean up and adopt --- .../python-modules/pydub/default.nix | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/pydub/default.nix b/pkgs/development/python-modules/pydub/default.nix index 6b67814a2220..3adf54281b77 100644 --- a/pkgs/development/python-modules/pydub/default.nix +++ b/pkgs/development/python-modules/pydub/default.nix @@ -1,8 +1,18 @@ -{ lib, stdenv, buildPythonPackage, fetchFromGitHub, scipy, ffmpeg-full }: +{ lib +, stdenv +, buildPythonPackage +, fetchFromGitHub + +# tests +, ffmpeg-full +, python +}: buildPythonPackage rec { pname = "pydub"; version = "0.25.1"; + format = "setuptools"; + # pypi version doesn't include required data files for tests src = fetchFromGitHub { owner = "jiaaro"; @@ -11,23 +21,24 @@ buildPythonPackage rec { sha256 = "0xskllq66wqndjfmvp58k26cv3w480sqsil6ifwp4gghir7hqc8m"; }; + pythonImportsCheck = [ + "pydub" + "pydub.audio_segment" + "pydub.playback" + ]; - # disable a test that fails on aarch64 due to rounding errors - postPatch = lib.optionalString stdenv.isAarch64 '' - substituteInPlace test/test.py \ - --replace "test_overlay_with_gain_change" "notest_overlay_with_gain_change" - ''; - - checkInputs = [ scipy ffmpeg-full ]; + checkInputs = [ + ffmpeg-full + ]; checkPhase = '' - python test/test.py + ${python.interpreter} test/test.py ''; meta = with lib; { - description = "Manipulate audio with a simple and easy high level interface."; - homepage = "http://pydub.com/"; - license = licenses.mit; - platforms = platforms.all; + description = "Manipulate audio with a simple and easy high level interface"; + homepage = "http://pydub.com"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; }; }