summary refs log tree commit diff
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2017-07-08 15:54:57 -0400
committerGitHub <noreply@github.com>2017-07-08 15:54:57 -0400
commit800d44984f50947122fa39de559127e416f0ddc8 (patch)
tree5a353b4f6e5fdacccbcad6e7e71f49da9ef80174
parent87514dd27af6b6b8e206143bdbf2642ca7084e9c (diff)
parentab162eeffca437cd218cc959b44b548a5a89f981 (diff)
downloadnixlib-800d44984f50947122fa39de559127e416f0ddc8.tar
nixlib-800d44984f50947122fa39de559127e416f0ddc8.tar.gz
nixlib-800d44984f50947122fa39de559127e416f0ddc8.tar.bz2
nixlib-800d44984f50947122fa39de559127e416f0ddc8.tar.lz
nixlib-800d44984f50947122fa39de559127e416f0ddc8.tar.xz
nixlib-800d44984f50947122fa39de559127e416f0ddc8.tar.zst
nixlib-800d44984f50947122fa39de559127e416f0ddc8.zip
Merge pull request #26968 from Infinisil/buku-tests-and-completions
buku: Enabled tests and added shell completion
-rw-r--r--pkgs/applications/misc/buku/default.nix33
1 files changed, 27 insertions, 6 deletions
diff --git a/pkgs/applications/misc/buku/default.nix b/pkgs/applications/misc/buku/default.nix
index 72ba96ad701f..ea3ca107d24d 100644
--- a/pkgs/applications/misc/buku/default.nix
+++ b/pkgs/applications/misc/buku/default.nix
@@ -1,8 +1,7 @@
-{ stdenv, pythonPackages, fetchFromGitHub,
-}:
+{ stdenv, pythonPackages, fetchFromGitHub }:
 
 with pythonPackages; buildPythonApplication rec {
-  version = "3.0";
+  version = "3.0"; # When updating to 3.1, make sure to remove the marked line in preCheck
   name = "buku-${version}";
 
   src = fetchFromGitHub {
@@ -12,6 +11,13 @@ with pythonPackages; buildPythonApplication rec {
     sha256 = "1a33x3197vi5s8rq5fvhy021jdlsc8ww8zc4kysss6r9mvdlk7ax";
   };
 
+  nativeBuildInputs = [
+    pytestcov
+    pytest-catchlog
+    hypothesis
+    pytest
+  ];
+
   propagatedBuildInputs = [
     cryptography
     beautifulsoup4
@@ -19,13 +25,28 @@ with pythonPackages; buildPythonApplication rec {
     urllib3
   ];
 
-  phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
+  preCheck = ''
+    # Fixes two tests for wrong encoding
+    export PYTHONIOENCODING=utf-8
+
+    ### Remove this for 3.1 ###
+    # See https://github.com/jarun/Buku/pull/167 (merged)
+    substituteInPlace setup.py \
+      --replace "hypothesis==3.7.0" "hypothesis>=3.7.0"
+
+    # Disables a test which requires internet
+    substituteInPlace tests/test_bukuDb.py \
+      --replace "@pytest.mark.slowtest" "@unittest.skip('skipping')"
+  '';
 
   installPhase = ''
     make install PREFIX=$out
-  '';
 
-  doCheck = false;
+    mkdir -p $out/share/zsh/site-functions $out/share/bash-completion/completions $out/share/fish/vendor_completions.d
+    cp auto-completion/zsh/* $out/share/zsh/site-functions
+    cp auto-completion/bash/* $out/share/bash-completion/completions
+    cp auto-completion/fish/* $out/share/fish/vendor_completions.d
+  '';
 
   meta = with stdenv.lib; {
     description = "Private cmdline bookmark manager";