1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, pytestCheckHook 5, pythonOlder 6, setuptools-scm 7}: 8 9buildPythonPackage rec { 10 pname = "asteval"; 11 version = "0.9.28"; 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-J35AqVSFpIsw0XThbLCJjS9NFRFeyYV/YrwdfcOrFhk="; 21 }; 22 23 SETUPTOOLS_SCM_PRETEND_VERSION = version; 24 25 nativeBuildInputs = [ 26 setuptools-scm 27 ]; 28 29 checkInputs = [ 30 pytestCheckHook 31 ]; 32 33 postPatch = '' 34 substituteInPlace setup.cfg \ 35 --replace " --cov=asteval --cov-report xml" "" 36 ''; 37 38 pythonImportsCheck = [ 39 "asteval" 40 ]; 41 42 meta = with lib; { 43 description = "AST evaluator of Python expression using ast module"; 44 homepage = "https://github.com/newville/asteval"; 45 license = with licenses; [ mit ]; 46 maintainers = with maintainers; [ fab ]; 47 }; 48}