summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyhcl/default.nix
blob: b40305c0dce290701b76fe0b692435d2071c163e (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
{ buildPythonPackage
, fetchFromGitHub
, isPy3k
, lib

# pythonPackages
, coverage
, pytest
}:

buildPythonPackage rec {
  pname = "pyhcl";
  version = "0.4.1";
  disabled = !isPy3k;

  src = fetchFromGitHub {
    owner = "virtuald";
    repo = pname;
    rev = version;
    sha256 = "13nszg2plfvza3syki1rxnx3k3h90qq4wkgv86l1xpz31k3pf6k4";
  };

  # https://github.com/virtuald/pyhcl/blob/51a7524b68fe21e175e157b8af931016d7a357ad/setup.py#L64
  configurePhase = ''
    echo '__version__ = "${version}"' > ./src/hcl/version.py
  '';

  checkInputs = [
    coverage
    pytest
  ];

  # https://github.com/virtuald/pyhcl/blob/51a7524b68fe21e175e157b8af931016d7a357ad/tests/run_tests.sh#L4
  checkPhase = ''
    coverage run --source hcl -m pytest tests
  '';

  meta = with lib; {
    description = "HCL is a configuration language. pyhcl is a python parser for it";
    homepage = "https://github.com/virtuald/pyhcl";
    license = licenses.mpl20;
    maintainers = with maintainers; [
      kamadorueda
    ];
  };
}