summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-11-21 13:52:07 +0100
committerFabian Affolter <mail@fabian-affolter.ch>2021-11-21 13:57:30 +0100
commit92322a1a6570cd153769a868d82d7afc87c6d69d (patch)
treec56354faf5fa7685dbba1f847f0ef228fef62b44 /pkgs/tools
parentf1e8640c5482f39b90864eadedab20c3f4b075c6 (diff)
downloadnixpkgs-92322a1a6570cd153769a868d82d7afc87c6d69d.tar
nixpkgs-92322a1a6570cd153769a868d82d7afc87c6d69d.tar.gz
nixpkgs-92322a1a6570cd153769a868d82d7afc87c6d69d.tar.bz2
nixpkgs-92322a1a6570cd153769a868d82d7afc87c6d69d.tar.lz
nixpkgs-92322a1a6570cd153769a868d82d7afc87c6d69d.tar.xz
nixpkgs-92322a1a6570cd153769a868d82d7afc87c6d69d.tar.zst
nixpkgs-92322a1a6570cd153769a868d82d7afc87c6d69d.zip
invoice2data: 0.2.93 -> 0.3.6
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/text/invoice2data/default.nix49
1 files changed, 41 insertions, 8 deletions
diff --git a/pkgs/tools/text/invoice2data/default.nix b/pkgs/tools/text/invoice2data/default.nix
index 8007724f4a5..941f2d6f493 100644
--- a/pkgs/tools/text/invoice2data/default.nix
+++ b/pkgs/tools/text/invoice2data/default.nix
@@ -1,21 +1,54 @@
-{ lib, python3Packages, xpdf, imagemagick, tesseract }:
+{ lib
+, fetchFromGitHub
+, imagemagick
+, python3
+, tesseract
+, xpdf
+}:
 
-python3Packages.buildPythonPackage rec {
+python3.pkgs.buildPythonApplication rec {
   pname = "invoice2data";
-  version = "0.2.93";
+  version = "0.3.6";
+  format = "setuptools";
 
-  src = python3Packages.fetchPypi {
-    inherit pname version;
-    sha256 = "1phz0a8jxg074k0im7shrrdfvdps7bn1fa4zwcf8q3sa2iig26l4";
+  src = fetchFromGitHub {
+    owner = "invoice-x";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-t1jgLyKtQsLINlnkCdSbVfTM6B/EiD1yGtx9UHjyZVE=";
   };
 
-  makeWrapperArgs = ["--prefix" "PATH" ":" (lib.makeBinPath [ imagemagick xpdf tesseract ]) ];
+  nativeBuildInputs = with python3.pkgs; [
+    setuptools-git
+  ];
 
-  propagatedBuildInputs = with python3Packages; [ unidecode dateparser pyyaml pillow chardet pdfminer ];
+  propagatedBuildInputs = with python3.pkgs; [
+    chardet
+    dateparser
+    pdfminer
+    pillow
+    pyyaml
+    unidecode
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.cfg \
+      --replace "pytest-runner" ""
+  '';
+
+  makeWrapperArgs = ["--prefix" "PATH" ":" (lib.makeBinPath [
+    imagemagick
+    tesseract
+    xpdf
+  ])];
 
   # Tests fails even when ran manually on my ubuntu machine !!
   doCheck = false;
 
+  pythonImportsCheck = [
+    "invoice2data"
+  ];
+
   meta = with lib; {
     description = "Data extractor for PDF invoices";
     homepage = "https://github.com/invoice-x/invoice2data";