1{
2 buildPythonPackage,
3 fetchFromGitHub,
4 isPy3k,
5 lib,
6
7 # pythonPackages
8 coverage,
9 pytest,
10}:
11
12buildPythonPackage rec {
13 pname = "pyhcl";
14 version = "0.4.5";
15 format = "setuptools";
16 disabled = !isPy3k;
17
18 src = fetchFromGitHub {
19 owner = "virtuald";
20 repo = "pyhcl";
21 rev = version;
22 sha256 = "sha256-vF40xEahs98G0lIC6XIl3eJHIuai2xTAeshUjiKN/BY=";
23 };
24
25 # https://github.com/virtuald/pyhcl/blob/51a7524b68fe21e175e157b8af931016d7a357ad/setup.py#L64
26 configurePhase = ''
27 echo '__version__ = "${version}"' > ./src/hcl/version.py
28 '';
29
30 nativeCheckInputs = [
31 coverage
32 pytest
33 ];
34
35 # https://github.com/virtuald/pyhcl/blob/51a7524b68fe21e175e157b8af931016d7a357ad/tests/run_tests.sh#L4
36 checkPhase = ''
37 coverage run --source hcl -m pytest tests
38 '';
39
40 meta = with lib; {
41 description = "HCL is a configuration language. pyhcl is a python parser for it";
42 mainProgram = "hcltool";
43 homepage = "https://github.com/virtuald/pyhcl";
44 license = licenses.mpl20;
45 maintainers = with maintainers; [ kamadorueda ];
46 };
47}