2021-02-05 17:12:51 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, colorama, mypy, pyyaml, regex
|
|
|
|
, dataclasses, typing
|
|
|
|
, pytestrunner, pytest-mypy
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "TatSu";
|
2021-03-19 17:17:44 +00:00
|
|
|
version = "5.5.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "neogeny";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-03-19 17:17:44 +00:00
|
|
|
sha256 = "07bmdnwh99p60cgzhlb8s5vwi5v4r5zi8shymxnnarannkc66hzn";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pytestrunner ];
|
|
|
|
propagatedBuildInputs = [ colorama mypy pyyaml regex ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optionals (pythonOlder "3.7") [ dataclasses ]
|
|
|
|
++ lib.optionals (pythonOlder "3.5") [ typing ];
|
2020-04-24 23:36:52 +00:00
|
|
|
checkInputs = [ pytest-mypy ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
pytest test/
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Generates Python parsers from grammars in a variation of EBNF";
|
|
|
|
longDescription = ''
|
|
|
|
TatSu (the successor to Grako) is a tool that takes grammars in a
|
|
|
|
variation of EBNF as input, and outputs memoizing (Packrat) PEG parsers in
|
|
|
|
Python.
|
|
|
|
'';
|
|
|
|
homepage = "https://tatsu.readthedocs.io/";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ primeos ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|