Merge pull request #292309 from fabaff/pydub-fix

python311Packages.pydub: refactor
This commit is contained in:
Fabian Affolter 2024-02-29 16:02:28 +01:00 committed by GitHub
commit aa51b7e410
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 47 additions and 22 deletions

View file

@ -1,21 +1,25 @@
{ lib
, python3Packages
, fetchFromGitHub
, python3
}:
python3Packages.buildPythonApplication rec {
python3.pkgs.buildPythonApplication rec {
pname = "ffsubsync";
version = "0.4.25";
format = "pyproject";
pyproject = true;
src = fetchFromGitHub {
owner = "smacke";
repo = "ffsubsync";
rev = version;
rev = "refs/tags/${version}";
hash = "sha256-ZdKZeKfAUe/FXLOur9Btb5RgXewmy3EHunQphqlxpIc=";
};
propagatedBuildInputs = with python3Packages; [
nativeBuildInputs = with python3.pkgs; [
setuptools
];
propagatedBuildInputs = with python3.pkgs; [
auditok
charset-normalizer
faust-cchardet
@ -32,9 +36,13 @@ python3Packages.buildPythonApplication rec {
webrtcvad
];
nativeCheckInputs = with python3Packages; [ pytestCheckHook ];
nativeCheckInputs = with python3.pkgs; [
pytestCheckHook
];
pythonImportsCheck = [ "ffsubsync" ];
pythonImportsCheck = [
"ffsubsync"
];
meta = with lib; {
homepage = "https://github.com/smacke/ffsubsync";

View file

@ -1,43 +1,59 @@
{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
# tests
, fetchpatch
, ffmpeg-full
, python
, pytestCheckHook
, pythonOlder
, setuptools
}:
buildPythonPackage rec {
pname = "pydub";
version = "0.25.1";
format = "setuptools";
pyproject = true;
disabled = pythonOlder "3.7";
# pypi version doesn't include required data files for tests
src = fetchFromGitHub {
owner = "jiaaro";
repo = pname;
rev = "v${version}";
sha256 = "0xskllq66wqndjfmvp58k26cv3w480sqsil6ifwp4gghir7hqc8m";
repo = "pydub";
rev = "refs/tags/v${version}";
hash = "sha256-FTEMT47wPXK5i4ZGjTVAhI/NjJio3F2dbBZzYzClU3c=";
};
patches = [
# Fix test assertions, https://github.com/jiaaro/pydub/pull/769
(fetchpatch {
name = "fix-assertions.patch";
url = "https://github.com/jiaaro/pydub/commit/66c1bf7813ae8621a71484fdcdf609734c0d8efd.patch";
hash = "sha256-3OIzvTgGK3r4/s5y7izHvouB4uJEmjO6cgKvegtTf7A=";
})
];
nativeBuildInputs = [
setuptools
];
nativeCheckInputs = [
ffmpeg-full
pytestCheckHook
];
pythonImportsCheck = [
"pydub"
"pydub.audio_segment"
"pydub.playback"
];
nativeCheckInputs = [
ffmpeg-full
pytestFlagsArray = [
"test/test.py"
];
checkPhase = ''
${python.interpreter} test/test.py
'';
meta = with lib; {
description = "Manipulate audio with a simple and easy high level interface";
homepage = "http://pydub.com";
changelog = "https://github.com/jiaaro/pydub/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ ];
};

View file

@ -72,6 +72,7 @@ buildPythonPackage rec {
changelog = "https://github.com/dotX12/ShazamIO/releases/tag/${src.rev}";
license = licenses.mit;
maintainers = with maintainers; [ figsoda ];
# https://github.com/shazamio/ShazamIO/issues/80
broken = versionAtLeast pydantic.version "2";
};
}