From fa6e7039b7c7bf9832ab6dbd7a40ce2a2c314d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81tila=20Saraiva?= Date: Wed, 23 Mar 2022 15:44:43 -0300 Subject: [PATCH] pyrevolve: init at 2.2 --- .../python-modules/pyrevolve/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/pyrevolve/default.nix diff --git a/pkgs/development/python-modules/pyrevolve/default.nix b/pkgs/development/python-modules/pyrevolve/default.nix new file mode 100644 index 000000000000..418d30a810c4 --- /dev/null +++ b/pkgs/development/python-modules/pyrevolve/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, contexttimer +, versioneer +, cython +, numpy +, pytest +}: + +buildPythonPackage rec { + pname = "pyrevolve"; + version = "2.2"; + + src = fetchFromGitHub { + owner = "devitocodes"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-5a4zvyf2vfz8aI6vFMI2vxekYrcUi/YuPFvZnUOx+Zs="; + }; + + nativeBuildInputs = [ versioneer cython ]; + propagatedBuildInputs = [ contexttimer ]; + + checkInputs = [ pytest numpy ]; + # Using approach bellow bcs the tests fail with the pytestCheckHook, throwing the following error + # ImportError: cannot import name 'crevolve' from partially initialized module 'pyrevolve' + # (most likely due to a circular import) + checkPhase = '' + pytest + ''; + + pythonImportsCheck = [ "pyrevolve" ]; + + meta = with lib; { + homepage = "https://github.com/devitocodes/pyrevolve"; + description = "Python library to manage checkpointing for adjoints"; + license = licenses.epl10; + maintainers = with maintainers; [ atila ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 184685a90480..4cf3394323cd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6349,6 +6349,8 @@ in { pypoolstation = callPackage ../development/python-modules/pypoolstation { }; + pyrevolve = callPackage ../development/python-modules/pyrevolve { }; + pyrfxtrx = callPackage ../development/python-modules/pyrfxtrx { }; pyrogram = callPackage ../development/python-modules/pyrogram { };