1{ 2 buildPythonPackage, 3 fetchFromGitHub, 4 lib, 5 6 # since this is a dependency of pytest, we need to avoid 7 # circular dependencies 8 jinja2, 9 railroad-diagrams, 10}: 11 12let 13 pyparsing = buildPythonPackage rec { 14 pname = "pyparsing"; 15 version = "2.4.7"; 16 17 src = fetchFromGitHub { 18 owner = "pyparsing"; 19 repo = pname; 20 rev = "pyparsing_${version}"; 21 sha256 = "14pfy80q2flgzjcx8jkracvnxxnr59kjzp3kdm5nh232gk1v6g6h"; 22 }; 23 24 # circular dependencies if enabled by default 25 doCheck = false; 26 nativeCheckInputs = [ 27 jinja2 28 railroad-diagrams 29 ]; 30 31 checkPhase = '' 32 python -m unittest 33 ''; 34 35 passthru.tests = { 36 check = pyparsing.overridePythonAttrs (_: { 37 doCheck = true; 38 }); 39 }; 40 41 meta = with lib; { 42 homepage = "https://github.com/pyparsing/pyparsing"; 43 description = "Alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions"; 44 license = licenses.mit; 45 }; 46 }; 47in 48pyparsing