Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 regex, 6 pytestCheckHook, 7 pythonOlder, 8 js2py, 9 setuptools, 10}: 11 12buildPythonPackage rec { 13 pname = "lark"; 14 version = "1.1.9"; 15 format = "pyproject"; 16 17 src = fetchFromGitHub { 18 owner = "lark-parser"; 19 repo = "lark"; 20 rev = "refs/tags/${version}"; 21 hash = "sha256-pWLKjELy10VNumpBHjBYCO2TltKsZx1GhQcGMHsYJNk="; 22 }; 23 24 nativeBuildInputs = [ setuptools ]; 25 26 # Optional import, but fixes some re known bugs & allows advanced regex features 27 propagatedBuildInputs = [ regex ]; 28 29 pythonImportsCheck = [ 30 "lark" 31 "lark.parsers" 32 "lark.tools" 33 "lark.grammars" 34 ]; 35 36 # Js2py is not supported on 3.12 37 doCheck = pythonOlder "3.12"; 38 39 nativeCheckInputs = [ 40 js2py 41 pytestCheckHook 42 ]; 43 44 meta = with lib; { 45 description = "Modern parsing library for Python, implementing Earley & LALR(1) and an easy interface"; 46 homepage = "https://lark-parser.readthedocs.io/"; 47 changelog = "https://github.com/lark-parser/lark/releases/tag/${version}"; 48 license = licenses.mit; 49 maintainers = with maintainers; [ drewrisinger ]; 50 }; 51}