Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / lark / default.nix
blob3158b626c2a63733a35bcbe10a3220be2c28d775
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , fetchpatch
5 , regex
6 , pytestCheckHook
7 , js2py
8 , setuptools
9 }:
11 buildPythonPackage rec {
12   pname = "lark";
13   version = "1.1.7";
14   format = "pyproject";
16   src = fetchFromGitHub {
17     owner = "lark-parser";
18     repo = "lark";
19     rev = "refs/tags/${version}";
20     hash = "sha256-k74tozIgJuwtUqKKmYHlfLpCWyT2hdoygRJiIpw+GDE=";
21   };
23   patches = [
24     # include .lark files in package data
25     # https://github.com/lark-parser/lark/pull/1308
26     (fetchpatch {
27       url = "https://github.com/lark-parser/lark/commit/656334cb8793fd4e08a12843eaced5a7bb518be3.patch";
28       hash = "sha256-pYeNnFfXJ8xkR0KsU/KMWJ8nF+BhP9PXEANiVhT254s=";
29     })
30   ];
32   nativeBuildInputs = [
33     setuptools
34   ];
36   # Optional import, but fixes some re known bugs & allows advanced regex features
37   propagatedBuildInputs = [ regex ];
39   pythonImportsCheck = [
40     "lark"
41     "lark.parsers"
42     "lark.tools"
43     "lark.grammars"
44   ];
46   nativeCheckInputs = [
47     js2py
48     pytestCheckHook
49   ];
51   meta = with lib; {
52     description = "A modern parsing library for Python, implementing Earley & LALR(1) and an easy interface";
53     homepage = "https://lark-parser.readthedocs.io/";
54     changelog = "https://github.com/lark-parser/lark/releases/tag/${version}";
55     license = licenses.mit;
56     maintainers = with maintainers; [ fridh drewrisinger ];
57   };