Merge pull request #183950 from onny/lark

This commit is contained in:
Sandro 2022-08-18 23:54:31 +02:00 committed by GitHub
commit 056e79ff46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 81 additions and 4 deletions

View File

@ -0,0 +1,37 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, tzlocal
, six
, pyjsparser
}:
buildPythonPackage rec {
pname = "js2py";
version = "0.71";
src = fetchFromGitHub {
owner = "PiotrDabkowski";
repo = "Js2Py";
rev = "5f665f60083a9796ec33861240ce31d6d2b844b6";
sha256 = "sha256-1omTV7zkYSQfxhkNgI4gtXTenWt9J1r3VARRHoRsSfc=";
};
propagatedBuildInputs = [
pyjsparser
six
tzlocal
];
# Test require network connection
doCheck = false;
pythonImportsCheck = [ "js2py" ];
meta = with lib; {
description = "JavaScript to Python Translator & JavaScript interpreter written in 100% pure Python";
homepage = "https://github.com/PiotrDabkowski/Js2Py";
license = licenses.mit;
maintainers = with maintainers; [ onny ];
};
}

View File

@ -4,6 +4,7 @@
, python
, regex
, pytestCheckHook
, js2py
}:
buildPythonPackage rec {
@ -27,10 +28,9 @@ buildPythonPackage rec {
"lark.grammars"
];
checkInputs = [ pytestCheckHook ];
disabledTestPaths = [
"tests/test_nearley/test_nearley.py" # requires unpackaged Js2Py library
checkInputs = [
js2py
pytestCheckHook
];
meta = with lib; {

View File

@ -0,0 +1,36 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, pytestCheckHook
, js2py
}:
let pyjsparser = buildPythonPackage rec {
pname = "pyjsparser";
version = "2.7.1";
src = fetchFromGitHub {
owner = "PiotrDabkowski";
repo = pname;
rev = "5465d037b30e334cb0997f2315ec1e451b8ad4c1";
sha256 = "sha256-Hqay9/qsjUfe62U7Q79l0Yy01L2Bnj5xNs6427k3Br8=";
};
checkInputs = [ pytestCheckHook js2py ];
# escape infinite recursion with js2py
doCheck = false;
passthru.tests = {
check = pyjsparser.overridePythonAttrs (_: { doCheck = true; });
};
pythonImportsCheck = [ "pyjsparser" ];
meta = with lib; {
description = "Fast javascript parser (based on esprima.js)";
homepage = "https://github.com/PiotrDabkowski/pyjsparser";
license = licenses.mit;
maintainers = with maintainers; [ onny ];
};
}; in pyjsparser

View File

@ -4681,6 +4681,8 @@ in {
inherit (pkgs) jq;
};
js2py = callPackage ../development/python-modules/js2py { };
jsbeautifier = callPackage ../development/python-modules/jsbeautifier { };
jschema-to-python = callPackage ../development/python-modules/jschema-to-python { };
@ -7740,6 +7742,8 @@ in {
pyjson5 = callPackage ../development/python-modules/pyjson5 { };
pyjsparser = callPackage ../development/python-modules/pyjsparser { };
pyjwkest = callPackage ../development/python-modules/pyjwkest { };
pyjwt = callPackage ../development/python-modules/pyjwt { };