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