1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 pytestCheckHook,
6 js2py,
7}:
8
9let
10 pyjsparser = buildPythonPackage rec {
11 pname = "pyjsparser";
12 version = "2.7.1";
13 format = "setuptools";
14
15 src = fetchFromGitHub {
16 owner = "PiotrDabkowski";
17 repo = pname;
18 rev = "5465d037b30e334cb0997f2315ec1e451b8ad4c1";
19 hash = "sha256-Hqay9/qsjUfe62U7Q79l0Yy01L2Bnj5xNs6427k3Br8=";
20 };
21
22 nativeCheckInputs = [
23 pytestCheckHook
24 js2py
25 ];
26
27 # escape infinite recursion with js2py
28 doCheck = false;
29
30 passthru.tests = {
31 check = pyjsparser.overridePythonAttrs (_: {
32 doCheck = true;
33 });
34 };
35
36 pythonImportsCheck = [ "pyjsparser" ];
37
38 meta = with lib; {
39 description = "Fast javascript parser (based on esprima.js)";
40 homepage = "https://github.com/PiotrDabkowski/pyjsparser";
41 license = licenses.mit;
42 maintainers = with maintainers; [ onny ];
43 };
44 };
45in
46pyjsparser