about summary refs log tree commit diff
path: root/pkgs/development/python-modules/bc-python-hcl2
diff options
context:
space:
mode:
authorLe Anh Duc <anhdle14@icloud.com>2020-12-23 14:10:07 +0900
committerLe Anh Duc <anhdle14@icloud.com>2021-01-03 19:37:39 +0900
commit90b522e0c693484fcdfb875cfe3518bfdc121ce9 (patch)
tree83356c5649f57f18368329fced1ac42fb1e99965 /pkgs/development/python-modules/bc-python-hcl2
parentb5fd71fbcefb10ae26aa1f2f9b3a1dc844f80500 (diff)
bc-python-hcl2: init at 0.3.11
Co-authored-by: Guillaume Girol <symphorien@users.noreply.github.com>
Diffstat (limited to 'pkgs/development/python-modules/bc-python-hcl2')
-rw-r--r--pkgs/development/python-modules/bc-python-hcl2/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/bc-python-hcl2/default.nix b/pkgs/development/python-modules/bc-python-hcl2/default.nix
new file mode 100644
index 0000000000000..34eab21bf5d02
--- /dev/null
+++ b/pkgs/development/python-modules/bc-python-hcl2/default.nix
@@ -0,0 +1,49 @@
+{ lib, buildPythonPackage, fetchPypi, nose }:
+
+let
+  lark-parser = buildPythonPackage rec {
+    pname = "lark-parser";
+    version = "0.7.8";
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "JiFeuxV+b7LudDGapERbnzt+RW4mviFc4Z/aqpAcIKQ=";
+    };
+
+    doCheck = true;
+  };
+in
+buildPythonPackage rec {
+  pname = "bc-python-hcl2";
+  version = "0.3.11";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "VZhI1oJ2EDZGyz3iI6/KYvJq4BGafzR+rcSgHqlUDrA=";
+  };
+
+  # Nose is required during build process, so can not use `checkInputs`.
+  buildInputs = [
+    nose
+  ];
+
+  propagatedBuildInputs = [
+    lark-parser
+  ];
+
+  pythonImportsCheck = [ "hcl2" ];
+
+  meta = with lib; {
+    description = "A parser for HCL2 written in Python using Lark";
+    longDescription = ''
+    A parser for HCL2 written in Python using Lark.
+    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.
+    '';
+    # 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;
+    maintainers = [ maintainers.anhdle14 ];
+  };
+}