2017-12-11 12:57:24 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2021-05-03 18:48:03 +01:00
|
|
|
, python
|
2021-04-02 20:15:34 +01:00
|
|
|
, regex
|
2017-12-11 12:57:24 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2018-11-07 09:56:22 +00:00
|
|
|
pname = "lark-parser";
|
2021-05-03 18:48:03 +01:00
|
|
|
version = "0.11.3";
|
2017-12-11 12:57:24 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2018-11-07 09:56:22 +00:00
|
|
|
owner = "lark-parser";
|
2017-12-11 12:57:24 +00:00
|
|
|
repo = "lark";
|
2018-11-07 09:56:22 +00:00
|
|
|
rev = version;
|
2021-05-03 18:48:03 +01:00
|
|
|
sha256 = "1ggvlzpdzlrxl46fgi8cfq2rzlwn21shpdkm4pknnhfjlsinv913";
|
2017-12-11 12:57:24 +00:00
|
|
|
};
|
|
|
|
|
2021-05-03 18:48:03 +01:00
|
|
|
# Optional import, but fixes some re known bugs & allows advanced regex features
|
2021-04-02 20:15:34 +01:00
|
|
|
propagatedBuildInputs = [ regex ];
|
2017-12-11 12:57:24 +00:00
|
|
|
|
2021-05-03 18:48:03 +01:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
# Official way to run the tests. Runs unittest internally.
|
|
|
|
# pytest produces issues with some test resource paths (relies on __main__)
|
|
|
|
${python.interpreter} -m tests
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
2021-04-02 20:15:34 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
2017-12-11 12:57:24 +00:00
|
|
|
description = "A modern parsing library for Python, implementing Earley & LALR(1) and an easy interface";
|
2021-05-03 18:48:03 +01:00
|
|
|
homepage = "https://lark-parser.readthedocs.io/";
|
|
|
|
changelog = "https://github.com/lark-parser/lark/releases/tag/${version}";
|
2021-04-02 20:15:34 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fridh drewrisinger ];
|
2017-12-11 12:57:24 +00:00
|
|
|
};
|
|
|
|
}
|