depot/third_party/nixpkgs/pkgs/development/python-modules/torchlibrosa/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

42 lines
996 B
Nix

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