1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pythonOlder,
7 setuptools-scm,
8}:
9
10buildPythonPackage rec {
11 pname = "asteval";
12 version = "0.9.32";
13 pyproject = true;
14
15 disabled = pythonOlder "3.8";
16
17 src = fetchFromGitHub {
18 owner = "lmfit";
19 repo = "asteval";
20 rev = "refs/tags/${version}";
21 hash = "sha256-3eML5lEKEUlp3Fwdgvk31an83x8no5ichskKvzYJDsE=";
22 };
23
24 postPatch = ''
25 substituteInPlace setup.cfg \
26 --replace-fail " --cov=asteval --cov-report xml" ""
27 '';
28
29 build-system = [ setuptools-scm ];
30
31 nativeCheckInputs = [ pytestCheckHook ];
32
33 pythonImportsCheck = [ "asteval" ];
34
35 disabledTests = [
36 # AssertionError: 'ImportError' != None
37 "test_set_default_nodehandler"
38 ];
39
40 meta = with lib; {
41 description = "AST evaluator of Python expression using ast module";
42 homepage = "https://github.com/lmfit/asteval";
43 changelog = "https://github.com/lmfit/asteval/releases/tag/${version}";
44 license = with licenses; [ mit ];
45 maintainers = with maintainers; [ fab ];
46 };
47}