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