2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2021-04-08 16:26:57 +00:00
|
|
|
, regex
|
2022-03-05 16:20:37 +00:00
|
|
|
, pytestCheckHook
|
2024-04-21 15:54:59 +00:00
|
|
|
, pythonOlder
|
2022-08-21 13:32:41 +00:00
|
|
|
, js2py
|
2023-11-16 04:20:00 +00:00
|
|
|
, setuptools
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-02-10 20:34:41 +00:00
|
|
|
pname = "lark";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.1.9";
|
2023-11-16 04:20:00 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lark-parser";
|
|
|
|
repo = "lark";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-pWLKjELy10VNumpBHjBYCO2TltKsZx1GhQcGMHsYJNk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
# Optional import, but fixes some re known bugs & allows advanced regex features
|
2021-04-08 16:26:57 +00:00
|
|
|
propagatedBuildInputs = [ regex ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"lark"
|
|
|
|
"lark.parsers"
|
|
|
|
"lark.tools"
|
|
|
|
"lark.grammars"
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
# Js2py is not supported on 3.12
|
|
|
|
doCheck = pythonOlder "3.12";
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-21 13:32:41 +00:00
|
|
|
js2py
|
|
|
|
pytestCheckHook
|
2022-03-05 16:20:37 +00:00
|
|
|
];
|
2021-04-08 16:26:57 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A modern parsing library for Python, implementing Earley & LALR(1) and an easy interface";
|
2021-05-20 23:08:51 +00:00
|
|
|
homepage = "https://lark-parser.readthedocs.io/";
|
|
|
|
changelog = "https://github.com/lark-parser/lark/releases/tag/${version}";
|
2021-04-08 16:26:57 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fridh drewrisinger ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|