2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools-scm,
|
2021-02-13 14:23:35 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "asteval";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.9.32";
|
|
|
|
pyproject = true;
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2021-02-13 14:23:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-05-15 15:35:15 +00:00
|
|
|
owner = "lmfit";
|
|
|
|
repo = "asteval";
|
2022-11-21 17:40:18 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-3eML5lEKEUlp3Fwdgvk31an83x8no5ichskKvzYJDsE=";
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail " --cov=asteval --cov-report xml" ""
|
2023-07-15 17:15:38 +00:00
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [ setuptools-scm ];
|
2021-07-14 22:03:04 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-02-13 14:23:35 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
pythonImportsCheck = [ "asteval" ];
|
2021-02-13 14:23:35 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
disabledTests = [
|
|
|
|
# AssertionError: 'ImportError' != None
|
|
|
|
"test_set_default_nodehandler"
|
|
|
|
];
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "AST evaluator of Python expression using ast module";
|
2024-05-15 15:35:15 +00:00
|
|
|
homepage = "https://github.com/lmfit/asteval";
|
|
|
|
changelog = "https://github.com/lmfit/asteval/releases/tag/${version}";
|
2021-02-13 14:23:35 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|