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