1{ lib
2, buildPythonPackage
3, fetchPypi
4, lark
5, nose
6, pythonOlder
7}:
8
9buildPythonPackage rec {
10 pname = "bc-python-hcl2";
11 version = "0.4.1";
12 format = "setuptools";
13
14 disabled = pythonOlder "3.6";
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-cqQ4zuztfS5MiY4hj1WipKunqIfB1kpM+RODcZPERrY=";
19 };
20
21 # Nose is required during build process, so can not use `nativeCheckInputs`.
22 buildInputs = [
23 nose
24 ];
25
26 propagatedBuildInputs = [
27 lark
28 ];
29
30 # This fork of python-hcl2 doesn't ship tests
31 doCheck = false;
32
33 pythonImportsCheck = [
34 "hcl2"
35 ];
36
37 meta = with lib; {
38 description = "Parser for HCL2 written in Python using Lark";
39 longDescription = ''
40 This parser only supports HCL2 and isn't backwards compatible with HCL v1.
41 It can be used to parse any HCL2 config file such as Terraform.
42 '';
43 # Although this is the main homepage from PyPi but it is also a homepage
44 # of another PyPi package (python-hcl2). But these two are different.
45 homepage = "https://github.com/amplify-education/python-hcl2";
46 license = licenses.mit;
47 maintainers = with maintainers; [ anhdle14 ];
48 };
49}