2021-10-28 06:52:43 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2022-03-10 19:12:11 +00:00
|
|
|
, lark
|
2021-10-28 06:52:43 +00:00
|
|
|
, nose
|
2022-02-20 05:27:41 +00:00
|
|
|
, pythonOlder
|
2021-10-28 06:52:43 +00:00
|
|
|
}:
|
2021-01-17 00:15:33 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bc-python-hcl2";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.4.1";
|
2022-02-20 05:27:41 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2021-01-17 00:15:33 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-cqQ4zuztfS5MiY4hj1WipKunqIfB1kpM+RODcZPERrY=";
|
2021-01-17 00:15:33 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
# Nose is required during build process, so can not use `nativeCheckInputs`.
|
2021-01-17 00:15:33 +00:00
|
|
|
buildInputs = [
|
|
|
|
nose
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2022-03-10 19:12:11 +00:00
|
|
|
lark
|
2021-01-17 00:15:33 +00:00
|
|
|
];
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
# This fork of python-hcl2 doesn't ship tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"hcl2"
|
|
|
|
];
|
2021-01-17 00:15:33 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-10-28 06:52:43 +00:00
|
|
|
description = "Parser for HCL2 written in Python using Lark";
|
2021-01-17 00:15:33 +00:00
|
|
|
longDescription = ''
|
2021-10-28 06:52:43 +00:00
|
|
|
This parser only supports HCL2 and isn't backwards compatible with HCL v1.
|
|
|
|
It can be used to parse any HCL2 config file such as Terraform.
|
2021-01-17 00:15:33 +00:00
|
|
|
'';
|
|
|
|
# Although this is the main homepage from PyPi but it is also a homepage
|
|
|
|
# of another PyPi package (python-hcl2). But these two are different.
|
|
|
|
homepage = "https://github.com/amplify-education/python-hcl2";
|
|
|
|
license = licenses.mit;
|
2021-10-28 06:52:43 +00:00
|
|
|
maintainers = with maintainers; [ anhdle14 ];
|
2021-01-17 00:15:33 +00:00
|
|
|
};
|
|
|
|
}
|