1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, python 5, regex 6}: 7 8buildPythonPackage rec { 9 pname = "lark-parser"; 10 version = "0.12.0"; 11 12 src = fetchFromGitHub { 13 owner = "lark-parser"; 14 repo = "lark"; 15 rev = version; 16 sha256 = "sha256-zcMGCn3ixD3dJg3GlC/ijs+U1JN1BodHLTXZc/5UR7Y="; 17 }; 18 19 # Optional import, but fixes some re known bugs & allows advanced regex features 20 propagatedBuildInputs = [ regex ]; 21 22 checkPhase = '' 23 runHook preCheck 24 25 # Official way to run the tests. Runs unittest internally. 26 # pytest produces issues with some test resource paths (relies on __main__) 27 ${python.interpreter} -m tests 28 29 runHook postCheck 30 ''; 31 32 meta = with lib; { 33 description = "A modern parsing library for Python, implementing Earley & LALR(1) and an easy interface"; 34 homepage = "https://lark-parser.readthedocs.io/"; 35 changelog = "https://github.com/lark-parser/lark/releases/tag/${version}"; 36 license = licenses.mit; 37 maintainers = with maintainers; [ fridh drewrisinger ]; 38 }; 39}