1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, mock
5, pyparsing
6, pytestCheckHook
7, python-dateutil
8, pythonOlder
9}:
10
11buildPythonPackage rec {
12 pname = "pyhocon";
13 version = "0.3.59";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = "chimpler";
20 repo = pname;
21 rev = version;
22 sha256 = "sha256-0BuDYheURFhtnWIh7Qw4LzZbk5tSqiNejo+08eglIvs=";
23 };
24
25 propagatedBuildInputs = [
26 pyparsing
27 python-dateutil
28 ];
29
30 checkInputs = [
31 mock
32 pytestCheckHook
33 ];
34
35 postPatch = ''
36 substituteInPlace setup.py \
37 --replace "pyparsing~=2.0" "pyparsing>=2.0"
38 '';
39
40 pythonImportsCheck = [
41 "pyhocon"
42 ];
43
44 disabledTestPaths = [
45 # pyparsing.exceptions.ParseException: Expected end of text, found '='
46 # https://github.com/chimpler/pyhocon/issues/273
47 "tests/test_tool.py"
48 ];
49
50 disabledTests = [
51 # AssertionError: assert ConfigTree([(...
52 "test_dict_merge"
53 "test_parse_override"
54 "test_include_dict"
55 ];
56
57 meta = with lib; {
58 description = "HOCON parser for Python";
59 homepage = "https://github.com/chimpler/pyhocon/";
60 longDescription = ''
61 A HOCON parser for Python. It additionally provides a tool (pyhocon) to convert
62 any HOCON content into JSON, YAML and properties format.
63 '';
64 license = licenses.asl20;
65 maintainers = with maintainers; [ chreekat ];
66 };
67}