1{ buildPythonPackage
2, fetchFromGitHub
3, lib
4
5# since this is a dependency of pytest, we need to avoid
6# circular dependencies
7, jinja2
8, railroad-diagrams
9}:
10
11let
12 pyparsing = buildPythonPackage rec {
13 pname = "pyparsing";
14 version = "2.4.7";
15
16 src = fetchFromGitHub {
17 owner = "pyparsing";
18 repo = pname;
19 rev = "pyparsing_${version}";
20 sha256 = "14pfy80q2flgzjcx8jkracvnxxnr59kjzp3kdm5nh232gk1v6g6h";
21 };
22
23 # circular dependencies if enabled by default
24 doCheck = false;
25 checkInputs = [
26 jinja2
27 railroad-diagrams
28 ];
29
30 checkPhase = ''
31 python -m unittest
32 '';
33
34 passthru.tests = {
35 check = pyparsing.overridePythonAttrs (_: { doCheck = true; });
36 };
37
38 meta = with lib; {
39 homepage = "https://github.com/pyparsing/pyparsing";
40 description = "An alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions";
41 license = licenses.mit;
42 };
43 };
44in
45 pyparsing