Merge pull request #183950 from onny/lark
This commit is contained in:
commit
056e79ff46
37
pkgs/development/python-modules/js2py/default.nix
Normal file
37
pkgs/development/python-modules/js2py/default.nix
Normal 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 ];
|
||||
};
|
||||
}
|
@ -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; {
|
||||
|
36
pkgs/development/python-modules/pyjsparser/default.nix
Normal file
36
pkgs/development/python-modules/pyjsparser/default.nix
Normal 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
|
@ -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 { };
|
||||
|
Loading…
Reference in New Issue
Block a user