1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00

python312Packages.pyannote-audio: refactor

This commit is contained in:
Fabian Affolter 2024-08-17 16:58:55 +02:00
parent 3c70aa8423
commit af9f6622b8

View file

@ -1,30 +1,32 @@
{ {
lib, lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
wheel,
asteroid-filterbanks, asteroid-filterbanks,
buildPythonPackage,
einops, einops,
fetchFromGitHub,
huggingface-hub, huggingface-hub,
pytorch-lightning, hydra-core,
numpy,
omegaconf, omegaconf,
pyannote-core, pyannote-core,
pyannote-database, pyannote-database,
pyannote-metrics, pyannote-metrics,
pyannote-pipeline, pyannote-pipeline,
pyscaffold,
pythonOlder,
pytorch-lightning,
pytorch-metric-learning, pytorch-metric-learning,
rich, rich,
semver, semver,
setuptools,
soundfile, soundfile,
speechbrain, speechbrain,
tensorboardx, tensorboardx,
torch,
torch-audiomentations, torch-audiomentations,
torch,
torchaudio, torchaudio,
torchmetrics, torchmetrics,
numpy, typer,
pyscaffold,
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -32,6 +34,8 @@ buildPythonPackage rec {
version = "3.3.0"; version = "3.3.0";
pyproject = true; pyproject = true;
disabled = pythonOlder "3.9";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "pyannote"; owner = "pyannote";
repo = "pyannote-audio"; repo = "pyannote-audio";
@ -40,20 +44,21 @@ buildPythonPackage rec {
fetchSubmodules = true; fetchSubmodules = true;
}; };
nativeBuildInputs = [ pythonRelaxDeps = [ "torchaudio" ];
build-system = [
pyscaffold pyscaffold
setuptools setuptools
wheel
]; ];
postPatch = '' postPatch = ''
substituteInPlace setup.cfg \ substituteInPlace setup.cfg \
--replace "pyscaffold>=3.2a0,<3.3a0" "pyscaffold" --replace-fail "pyscaffold>=3.2a0,<3.3a0" "pyscaffold"
substituteInPlace requirements.txt \ substituteInPlace requirements.txt \
--replace "lightning" "pytorch-lightning" --replace-fail "lightning" "pytorch-lightning"
''; '';
propagatedBuildInputs = [ dependencies = [
asteroid-filterbanks asteroid-filterbanks
einops einops
huggingface-hub huggingface-hub
@ -76,6 +81,13 @@ buildPythonPackage rec {
pytorch-lightning pytorch-lightning
]; ];
optional-dependencies = {
cli = [
hydra-core
typer
];
};
pythonImportsCheck = [ "pyannote.audio" ]; pythonImportsCheck = [ "pyannote.audio" ];
meta = with lib; { meta = with lib; {