summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyhocon/default.nix
blob: f9014f5db2b751cc9f07d8e2a5b3708ccc95b857 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ lib
, buildPythonPackage
, fetchFromGitHub
, mock
, pyparsing
, pytestCheckHook
, python-dateutil
, pythonOlder
}:

buildPythonPackage rec {
  pname = "pyhocon";
  version = "0.3.59";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "chimpler";
    repo = pname;
    rev = version;
    sha256 = "sha256-0BuDYheURFhtnWIh7Qw4LzZbk5tSqiNejo+08eglIvs=";
  };

  propagatedBuildInputs = [
    pyparsing
    python-dateutil
  ];

  checkInputs = [
    mock
    pytestCheckHook
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace "pyparsing~=2.0" "pyparsing>=2.0"
  '';

  pythonImportsCheck = [
    "pyhocon"
  ];

  disabledTestPaths = [
    # pyparsing.exceptions.ParseException: Expected end of text, found '='
    # https://github.com/chimpler/pyhocon/issues/273
    "tests/test_tool.py"
  ];

  disabledTests = [
    # AssertionError: assert ConfigTree([(...
    "test_dict_merge"
    "test_parse_override"
    "test_include_dict"
  ];

  meta = with lib; {
    description = "HOCON parser for Python";
    homepage = "https://github.com/chimpler/pyhocon/";
    longDescription = ''
      A HOCON parser for Python. It additionally provides a tool (pyhocon) to convert
      any HOCON content into JSON, YAML and properties format.
    '';
    license = licenses.asl20;
    maintainers = with maintainers; [ chreekat ];
  };
}