1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pythonOlder,
7 setuptools-scm,
8}:
9
10buildPythonPackage rec {
11 pname = "asteval";
12 version = "1.0.1";
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-Ee7EAcSfLmo9ijm4oa3nEVPoz1pgLx4ozbSXBW3kRPw=";
22 };
23
24 postPatch = ''
25 substituteInPlace pyproject.toml \
26 --replace-fail "--cov=asteval --cov-report html" ""
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}