summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2021-06-17 06:22:52 +0000
committerGitHub <noreply@github.com>2021-06-17 06:22:52 +0000
commitc285ab05df4e4793fba3a278bed414cc600725d1 (patch)
tree6754ee14365c76580c403440f9ed3e49cda66860
parent91ca0ed7b9f9e31eb97522cc9d583c5497a476b4 (diff)
parent4a8d262c7c485caf9648acb0a6f757a1ccd9e1c3 (diff)
downloadnixpkgs-c285ab05df4e4793fba3a278bed414cc600725d1.tar
nixpkgs-c285ab05df4e4793fba3a278bed414cc600725d1.tar.gz
nixpkgs-c285ab05df4e4793fba3a278bed414cc600725d1.tar.bz2
nixpkgs-c285ab05df4e4793fba3a278bed414cc600725d1.tar.lz
nixpkgs-c285ab05df4e4793fba3a278bed414cc600725d1.tar.xz
nixpkgs-c285ab05df4e4793fba3a278bed414cc600725d1.tar.zst
nixpkgs-c285ab05df4e4793fba3a278bed414cc600725d1.zip
Merge pull request #127024 from pacien/visidata-deps
visidata: add missing deps, enable tests
-rw-r--r--pkgs/applications/misc/visidata/default.nix74
1 files changed, 63 insertions, 11 deletions
diff --git a/pkgs/applications/misc/visidata/default.nix b/pkgs/applications/misc/visidata/default.nix
index ad49a1b291e..9663d09304f 100644
--- a/pkgs/applications/misc/visidata/default.nix
+++ b/pkgs/applications/misc/visidata/default.nix
@@ -1,17 +1,26 @@
-{ buildPythonApplication
+{ stdenv
 , lib
+, buildPythonApplication
 , fetchFromGitHub
 , dateutil
-, pyyaml
+, pandas
+, requests
+, lxml
 , openpyxl
 , xlrd
 , h5py
-, fonttools
-, lxml
-, pandas
+, psycopg2
 , pyshp
+, fonttools
+, pyyaml
+, pdfminer
+, vobject
+, tabulate
+, wcwidth
+, zstandard
 , setuptools
-, withPcap ? true, dpkt ? null, dnslib ? null
+, git
+, withPcap ? true, dpkt, dnslib
 }:
 buildPythonApplication rec {
   pname = "visidata";
@@ -25,19 +34,62 @@ buildPythonApplication rec {
   };
 
   propagatedBuildInputs = [
+    # from visidata/requirements.txt
+    # packages not (yet) present in nixpkgs are commented
     dateutil
-    pyyaml
+    pandas
+    requests
+    lxml
     openpyxl
     xlrd
     h5py
-    fonttools
-    lxml
-    pandas
+    psycopg2
     pyshp
+    #mapbox-vector-tile
+    #pypng
+    fonttools
+    #sas7bdat
+    #xport
+    #savReaderWriter
+    pyyaml
+    #namestand
+    #datapackage
+    pdfminer
+    #tabula
+    vobject
+    tabulate
+    wcwidth
+    zstandard
     setuptools
   ] ++ lib.optionals withPcap [ dpkt dnslib ];
 
-  doCheck = false;
+  checkInputs = [
+    git
+  ];
+
+  # check phase uses the output bin, which is not possible when cross-compiling
+  doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
+
+  checkPhase = ''
+    # disable some tests which require access to the network
+    rm tests/load-http.vd            # http
+    rm tests/graph-cursor-nosave.vd  # http
+    rm tests/messenger-nosave.vd     # dns
+
+    # disable some tests which expect Python == 3.6 (not our current version)
+    # see https://github.com/saulpw/visidata/issues/1014
+    rm tests/describe.vd
+    rm tests/describe-error.vd
+    rm tests/edit-type.vd
+
+    # tests use git to compare outputs to references
+    git init -b "test-reference"
+    git config user.name "nobody"; git config user.email "no@where"
+    git add .; git commit -m "test reference"
+
+    substituteInPlace dev/test.sh --replace "bin/vd" "$out/bin/vd"
+    bash dev/test.sh
+  '';
 
   meta = {
     inherit version;