1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 julius,
6 librosa,
7 pytest-cov-stub,
8 pytestCheckHook,
9 pythonOlder,
10 setuptools,
11 torch-pitch-shift,
12 torch,
13 torchaudio,
14}:
15
16buildPythonPackage rec {
17 pname = "torch-audiomentations";
18 version = "0.12.0";
19 pyproject = true;
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchFromGitHub {
24 owner = "asteroid-team";
25 repo = "torch-audiomentations";
26 tag = "v${version}";
27 hash = "sha256-5ccVO1ECiIn0q7m8ZLHxqD2fhaXeMDKUEswa49dRTsY=";
28 };
29
30 pythonRelaxDeps = [ "torchaudio" ];
31
32 build-system = [ setuptools ];
33
34 dependencies = [
35 julius
36 librosa
37 torch
38 torchaudio
39 torch-pitch-shift
40 ];
41
42 nativeCheckInputs = [
43 pytest-cov-stub
44 pytestCheckHook
45 ];
46
47 pythonImportsCheck = [ "torch_audiomentations" ];
48
49 disabledTestPaths = [
50 # librosa issues
51 "tests/test_mix.py"
52 "tests/test_convolution.py"
53 "tests/test_impulse_response.py"
54 "tests/test_background_noise.py"
55 ];
56
57 disabledTests = [ "test_transform_is_differentiable" ];
58
59 meta = with lib; {
60 description = "Fast audio data augmentation in PyTorch";
61 homepage = "https://github.com/asteroid-team/torch-audiomentations";
62 changelog = "https://github.com/asteroid-team/torch-audiomentations/releases/tag/v${version}";
63 license = licenses.mit;
64 maintainers = with maintainers; [ matthewcroughan ];
65 };
66}