2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, contexttimer
|
|
|
|
, versioneer
|
|
|
|
, cython
|
|
|
|
, numpy
|
|
|
|
, pytest
|
2023-05-24 13:37:59 +00:00
|
|
|
, pythonOlder
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyrevolve";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "2.2.2";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "devitocodes";
|
|
|
|
repo = pname;
|
2023-05-24 13:37:59 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-JLDn3WEBcdO8YYzt/MWOHB/1kcmbmZUsiH00/4Uwlxo=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
versioneer
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
contexttimer
|
|
|
|
numpy
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytest ];
|
2022-04-27 09:35:20 +00:00
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pyrevolve"
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/devitocodes/pyrevolve";
|
2023-05-24 13:37:59 +00:00
|
|
|
changelog = "https://github.com/devitocodes/pyrevolve/releases/tag/v${version}";
|
2022-04-27 09:35:20 +00:00
|
|
|
description = "Python library to manage checkpointing for adjoints";
|
|
|
|
license = licenses.epl10;
|
|
|
|
maintainers = with maintainers; [ atila ];
|
|
|
|
};
|
|
|
|
}
|