about summary refs log tree commit diff
path: root/pkgs/development/python-modules/torchlibrosa/default.nix
blob: 9ea19d6157a54a3a8a1ad8b60721188c629f6f0e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
  stdenv,
  lib,
  buildPythonPackage,
  fetchPypi,
  librosa,
  numpy,
  torch,
}:

buildPythonPackage rec {
  pname = "torchlibrosa";
  version = "0.1.0";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-Yqi+7fnJtBQaBiNN8/ECKfe6huZ2eMzuAkiexO8EQCg=";
  };

  propagatedBuildInputs = [
    librosa
    numpy
    torch
  ];

  # Project has no tests.
  # In order to make pythonImportsCheck work, NUMBA_CACHE_DIR env var need to
  # be set to a writable dir (https://github.com/numba/numba/issues/4032#issuecomment-488102702).
  # pythonImportsCheck has no pre* hook, use checkPhase to workaround that.
  checkPhase = ''
    export NUMBA_CACHE_DIR="$(mktemp -d)"
  '';
  pythonImportsCheck = [ "torchlibrosa" ];

  meta = with lib; {
    description = "PyTorch implemention of part of librosa functions";
    homepage = "https://github.com/qiuqiangkong/torchlibrosa";
    license = licenses.mit;
    maintainers = with maintainers; [ azuwis ];
  };
}