Unverified Commit 3d6ac6a6 authored by Yt's avatar Yt Committed by GitHub
Browse files

python312Packages.{pdfplumber,unstructured-api}: require pypdfium2 (#378649)

parents 8c5b9f72 e8a1eaac
Loading
Loading
Loading
Loading
+11 −26
Original line number Diff line number Diff line
@@ -9,11 +9,11 @@
  pandas-stubs,
  pdfminer-six,
  pillow,
  pypdfium2,
  pytest-cov,
  pytest-parallel,
  pytestCheckHook,
  pythonOlder,
  types-pillow,
  wand,
}:

buildPythonPackage rec {
@@ -21,8 +21,6 @@ buildPythonPackage rec {
  version = "0.11.5";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "jsvine";
    repo = "pdfplumber";
@@ -30,19 +28,17 @@ buildPythonPackage rec {
    hash = "sha256-oe6lZyQKXASzG7Ho6o7mlXY+BOgVBaACebxbYD+1+x0=";
  };

  postPatch = ''
    substituteInPlace setup.cfg \
      --replace "--cov=pdfplumber --cov-report xml:coverage.xml --cov-report term" ""
  '';

  propagatedBuildInputs = [
  dependencies = [
    pdfminer-six
    pillow
    wand
    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 = [
@@ -51,6 +47,7 @@ buildPythonPackage rec {
    nbexec
    pandas
    pandas-stubs
    pytest-cov
    pytest-parallel
    pytestCheckHook
    types-pillow
@@ -58,24 +55,12 @@ buildPythonPackage rec {

  pythonImportsCheck = [ "pdfplumber" ];

  disabledTests = [
    # flaky
    "test__repr_png_"
  ];

  disabledTestPaths = [
    # Tests requires pypdfium2
    "tests/test_display.py"
    # Tests requires pypdfium2
    "tests/test_issues.py"
  ];

  meta = with lib; {
  meta = {
    description = "Plumb a PDF for detailed information about each char, rectangle, line, et cetera — and easily extract text and tables";
    mainProgram = "pdfplumber";
    homepage = "https://github.com/jsvine/pdfplumber";
    changelog = "https://github.com/jsvine/pdfplumber/releases/tag/v${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ happysalada ];
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ happysalada ];
  };
}
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ let
      pypandoc
      pyparsing
      pypdf
      # pypdfium2
      pypdfium2
      python-dateutil
      python-docx
      # python-iso639