python3Packages.pydub: clean up and adopt

This commit is contained in:
Martin Weinelt 2021-12-25 20:38:14 +01:00
parent 7580fbb4be
commit ec7062492f
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -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 ];
};
}