1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 six,
6 lark,
7 pytestCheckHook,
8}:
9
10buildPythonPackage rec {
11 pname = "commentjson";
12 version = "0.9.0";
13 format = "setuptools";
14
15 src = fetchFromGitHub {
16 owner = "vaidik";
17 repo = "commentjson";
18 rev = "v${version}";
19 hash = "sha256-dPnIcv7TIeyG7rU938w7FrDklmaGuPpXz34uw/JjOgY=";
20 };
21
22 postPatch = ''
23 substituteInPlace setup.py \
24 --replace "lark-parser>=0.7.1,<0.8.0" "lark"
25
26 # NixOS is missing test.test_json module
27 rm -r commentjson/tests/test_json
28 '';
29
30 propagatedBuildInputs = [
31 lark
32 six
33 ];
34
35 nativeCheckInputs = [ pytestCheckHook ];
36
37 pythonImportsCheck = [ "commentjson" ];
38
39 meta = with lib; {
40 description = "Add JavaScript or Python style comments in JSON";
41 homepage = "https://github.com/vaidik/commentjson/";
42 license = licenses.mit;
43 maintainers = [ ];
44 };
45}