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-09-26 11:04:55 +00:00
|
|
|
version = "1.0.4";
|
2024-05-15 15:35:15 +00:00
|
|
|
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-09-26 11:04:55 +00:00
|
|
|
hash = "sha256-rq8qZqTtnKyVclX5R+yRouLz1FySRgc7DMN9W9UBkyI=";
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
postPatch = ''
|
2024-07-27 06:49:29 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-fail "--cov=asteval --cov-report html" ""
|
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 ];
|
|
|
|
};
|
|
|
|
}
|