summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorKevin Amado <kamadorueda@gmail.com>2020-01-23 22:07:51 -0500
committerJon <jonringer@users.noreply.github.com>2020-01-24 01:53:35 -0800
commitdac34b3803af7736c6cc26b7ba2b84a7e0337fc5 (patch)
tree36ee79f200d915cedf1e15b52db6130cc88ff7f7 /pkgs/development
parent268180742c11c1dbed7e3bfabcfc619ce01255da (diff)
downloadnixpkgs-dac34b3803af7736c6cc26b7ba2b84a7e0337fc5.tar
nixpkgs-dac34b3803af7736c6cc26b7ba2b84a7e0337fc5.tar.gz
nixpkgs-dac34b3803af7736c6cc26b7ba2b84a7e0337fc5.tar.bz2
nixpkgs-dac34b3803af7736c6cc26b7ba2b84a7e0337fc5.tar.lz
nixpkgs-dac34b3803af7736c6cc26b7ba2b84a7e0337fc5.tar.xz
nixpkgs-dac34b3803af7736c6cc26b7ba2b84a7e0337fc5.tar.zst
nixpkgs-dac34b3803af7736c6cc26b7ba2b84a7e0337fc5.zip
pythonPackages.pyhcl: init at 0.4.0
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/pyhcl/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pyhcl/default.nix b/pkgs/development/python-modules/pyhcl/default.nix
new file mode 100644
index 00000000000..e409282980d
--- /dev/null
+++ b/pkgs/development/python-modules/pyhcl/default.nix
@@ -0,0 +1,46 @@
+{ buildPythonPackage
+, fetchFromGitHub
+, isPy3k
+, lib
+
+# pythonPackages
+, coverage
+, pytest
+}:
+
+buildPythonPackage rec {
+  pname = "pyhcl";
+  version = "0.4.0";
+  disabled = !isPy3k;
+
+  src = fetchFromGitHub {
+    owner = "virtuald";
+    repo = pname;
+    rev = version;
+    sha256 = "09kwm3digbwn3kmbk76jswxgwfcfchik6cfa2xbhjanh4xs893hs";
+  };
+
+  # https://github.com/virtuald/pyhcl/blob/51a7524b68fe21e175e157b8af931016d7a357ad/setup.py#L64
+  configurePhase = ''
+    echo '__version__ = "${version}"' > ./src/hcl/version.py
+  '';
+
+  checkInputs = [
+    coverage
+    pytest
+  ];
+
+  # https://github.com/virtuald/pyhcl/blob/51a7524b68fe21e175e157b8af931016d7a357ad/tests/run_tests.sh#L4
+  checkPhase = ''
+    coverage run --source hcl -m pytest tests
+  '';
+
+  meta = with lib; {
+    description = "HCL is a configuration language. pyhcl is a python parser for it";
+    homepage = "https://github.com/virtuald/pyhcl";
+    license = licenses.mpl20;
+    maintainers = with maintainers; [
+      kamadorueda
+    ];
+  };
+}