about summary refs log tree commit diff
path: root/pkgs/development/python-modules/cram
diff options
context:
space:
mode:
authorJaakko Luttinen <jaakko.luttinen@iki.fi>2017-05-07 14:00:23 +0300
committerJaakko Luttinen <jaakko.luttinen@iki.fi>2017-05-08 11:14:40 +0300
commit4a89ab35eef00098a7edc1c0ffa990929e14ba57 (patch)
treed1bf1be527f520c77099655eabb3acb1523d68fe /pkgs/development/python-modules/cram
parent994299b7a9f8ad0a03d19ab0cf74047c481b9fde (diff)
downloadnixlib-4a89ab35eef00098a7edc1c0ffa990929e14ba57.tar
nixlib-4a89ab35eef00098a7edc1c0ffa990929e14ba57.tar.gz
nixlib-4a89ab35eef00098a7edc1c0ffa990929e14ba57.tar.bz2
nixlib-4a89ab35eef00098a7edc1c0ffa990929e14ba57.tar.lz
nixlib-4a89ab35eef00098a7edc1c0ffa990929e14ba57.tar.xz
nixlib-4a89ab35eef00098a7edc1c0ffa990929e14ba57.tar.zst
nixlib-4a89ab35eef00098a7edc1c0ffa990929e14ba57.zip
pythonPackages.cram: init at 0.7
Diffstat (limited to 'pkgs/development/python-modules/cram')
-rw-r--r--pkgs/development/python-modules/cram/default.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/cram/default.nix b/pkgs/development/python-modules/cram/default.nix
new file mode 100644
index 000000000000..3ba861f1c874
--- /dev/null
+++ b/pkgs/development/python-modules/cram/default.nix
@@ -0,0 +1,38 @@
+{lib, buildPythonPackage, fetchPypi, coverage, bash, which, writeText}:
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  version = "0.7";
+  pname = "cram";
+
+  buildInputs = [ coverage which ];
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0bvz6fwdi55rkrz3f50zsy35gvvwhlppki2yml5bj5ffy9d499vx";
+  };
+
+  postPatch = ''
+    substituteInPlace tests/test.t \
+      --replace "/bin/bash" "${bash}/bin/bash"
+  '';
+
+  # This testing is copied from Makefile. Simply using `make test` doesn't work
+  # because it uses the unpatched `scripts/cram` executable which has a bad
+  # shebang. Also, for some reason, coverage fails on one file so let's just
+  # ignore that one.
+  checkPhase = ''
+    # scripts/cram tests
+    #COVERAGE=${coverage}/bin/coverage $out/bin/cram tests
+    #${coverage}/bin/coverage report --fail-under=100
+    COVERAGE=coverage $out/bin/cram tests
+    coverage report --fail-under=100 --omit="*/_encoding.py"
+  '';
+
+  meta = {
+    description = "A simple testing framework for command line applications";
+    homepage = https://bitheap.org/cram/;
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [ jluttine ];
+  };
+}