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