Commit b6007cee authored by emaryn's avatar emaryn
Browse files
parent 2747c473
Loading
Loading
Loading
Loading
+18 −11
Original line number Diff line number Diff line
{
  lib,
  pkgs,
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  jupyterlab,
  nbexec,
  pandas,
@@ -14,33 +15,29 @@
  pytest-parallel,
  pytestCheckHook,
  types-pillow,
  writableTmpDirAsHomeHook,
}:

buildPythonPackage rec {
  pname = "pdfplumber";
  version = "0.11.5";
  format = "setuptools";
  version = "0.11.6";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "jsvine";
    repo = "pdfplumber";
    tag = "v${version}";
    hash = "sha256-oe6lZyQKXASzG7Ho6o7mlXY+BOgVBaACebxbYD+1+x0=";
    hash = "sha256-ljoM252w0oOqTUgYT6jtAW+jElPU9a49K6Atwdv5Dvo=";
  };

  build-system = [ setuptools ];

  dependencies = [
    pdfminer-six
    pillow
    pypdfium2
  ];

  preCheck = ''
    export HOME=$(mktemp -d)
    # test_issue_1089 assumes the soft limit on open files is "low", otherwise it never completes
    # reported at: https://github.com/jsvine/pdfplumber/issues/1263
    ulimit -n 1024
  '';

  nativeCheckInputs = [
    pkgs.ghostscript
    jupyterlab
@@ -51,6 +48,16 @@ buildPythonPackage rec {
    pytest-parallel
    pytestCheckHook
    types-pillow
    writableTmpDirAsHomeHook
  ];

  pythonRelaxDeps = [ "pdfminer.six" ];

  disabledTestPaths = [
    # AssertionError
    "tests/test_convert.py::Test::test_cli_csv"
    "tests/test_convert.py::Test::test_cli_csv_exclude"
    "tests/test_convert.py::Test::test_csv"
  ];

  pythonImportsCheck = [ "pdfplumber" ];