diff --git a/pkgs/development/python-modules/deepwave/default.nix b/pkgs/development/python-modules/deepwave/default.nix new file mode 100644 index 00000000000..837259380ae --- /dev/null +++ b/pkgs/development/python-modules/deepwave/default.nix @@ -0,0 +1,59 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytorch +, ninja +, scipy +, which +, pybind11 +, pytest-xdist +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "deepwave"; + version = "0.0.11"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "ar4"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-d4EahmzHACHaeKoNZy63OKwWZdlHbUydrbr4fD43X8s="; + }; + + # unable to find ninja although it is available, most likely because it looks for its pip version + postPatch = '' + substituteInPlace setup.cfg --replace "ninja" "" + ''; + + # The source files are compiled at runtime and cached at the + # $HOME/.cache folder, so for the check phase it is needed to + # have a temporary home. This is also the reason ninja is not + # needed at the nativeBuildInputs, since it will only be used + # at runtime. The user will have to add it to its nix-shell + # along with deepwave + preBuild = '' + export HOME=$(mktemp -d) + ''; + + propagatedBuildInputs = [ pytorch pybind11 ]; + + checkInputs = [ + ninja + which + scipy + pytest-xdist + pytestCheckHook + ]; + + pythonImportsCheck = [ "deepwave" ]; + + meta = with lib; { + description = "Wave propagation modules for PyTorch"; + homepage = "https://github.com/ar4/deepwave"; + license = licenses.mit; + platforms = intersectLists platforms.x86_64 platforms.linux; + maintainers = with maintainers; [ atila ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 78a1d34e399..e9d71c68435 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2195,6 +2195,8 @@ in { deeptoolsintervals = callPackage ../development/python-modules/deeptoolsintervals { }; + deepwave = callPackage ../development/python-modules/deepwave { }; + deep-translator = callPackage ../development/python-modules/deep-translator { }; deezer-py = callPackage ../development/python-modules/deezer-py { };