deepwave: 0.0.11 -> 0.0.12 (#182024)

This commit is contained in:
Átila Saraiva Quintela Soares 2022-07-25 10:08:14 -03:00 committed by GitHub
parent 280928ea7d
commit e96b070d89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,29 +10,40 @@
, pytestCheckHook
}:
let
linePatch = ''
import os
os.environ['PATH'] = os.environ['PATH'] + ':${ninja}/bin'
'';
in
buildPythonPackage rec {
pname = "deepwave";
version = "0.0.11";
version = "0.0.12";
format = "pyproject";
src = fetchFromGitHub {
owner = "ar4";
repo = pname;
rev = "v${version}";
sha256 = "sha256-d4EahmzHACHaeKoNZy63OKwWZdlHbUydrbr4fD43X8s=";
sha256 = "sha256-WWu0LyHlOwWMVPUy+LAszKF3VlgcqlcMlDi4oon4Dl8=";
};
# unable to find ninja although it is available, most likely because it looks for its pip version
postPatch = ''
substituteInPlace setup.cfg --replace "ninja" ""
# Adding ninja to the path forcibly
mv src/deepwave/__init__.py tmp
echo "${linePatch}" > src/deepwave/__init__.py
cat tmp >> src/deepwave/__init__.py
rm tmp
'';
# 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
# at runtime.
preBuild = ''
export HOME=$(mktemp -d)
'';
@ -40,7 +51,6 @@ buildPythonPackage rec {
propagatedBuildInputs = [ pytorch pybind11 ];
checkInputs = [
ninja
which
scipy
pytest-xdist