Merge pull request #298992 from fabaff/llama-index-readers-file-bump

python311Packages.llama-index-readers-file: 0.1.7 -> 0.1.12
This commit is contained in:
Fabian Affolter 2024-03-25 23:16:25 +01:00 committed by GitHub
commit 49c05c0720
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 97 additions and 19 deletions

View File

@ -1,27 +1,30 @@
{ lib { lib
, beautifulsoup4 , beautifulsoup4
, buildPythonPackage , buildPythonPackage
, fetchFromGitHub , fetchPypi
, llama-index-core , llama-index-core
, poetry-core , poetry-core
, pymupdf , pymupdf
, pypdf , pypdf
, pytestCheckHook , pythonOlder
, pythonRelaxDepsHook , pythonRelaxDepsHook
, striprtf
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "llama-index-readers-file"; pname = "llama-index-readers-file";
version = "0.1.7"; version = "0.1.12";
inherit (llama-index-core) src meta;
pyproject = true; pyproject = true;
sourceRoot = "${src.name}/llama-index-integrations/readers/${pname}"; disabled = pythonOlder "3.8";
src = fetchPypi {
pname = "llama_index_readers_file";
inherit version;
hash = "sha256-YGXL+AsPtdGJVYuLkK273JKsuGFH/KGS2I/MJwStKvM=";
};
pythonRelaxDeps = [ pythonRelaxDeps = [
"beautifulsoup4"
"pymupdf" "pymupdf"
"pypdf" "pypdf"
]; ];
@ -30,23 +33,30 @@ buildPythonPackage rec {
"bs4" "bs4"
]; ];
nativeBuildInputs = [ build-system = [
poetry-core poetry-core
pythonRelaxDepsHook pythonRelaxDepsHook
]; ];
propagatedBuildInputs = [ dependencies = [
beautifulsoup4 beautifulsoup4
llama-index-core llama-index-core
pymupdf pymupdf
pypdf pypdf
striprtf
]; ];
nativeCheckInputs = [ # Tests are only available in the mono repo
pytestCheckHook doCheck = false;
];
pythonImportsCheck = [ pythonImportsCheck = [
"llama_index.readers.file" "llama_index.readers.file"
]; ];
meta = with lib; {
description = "LlamaIndex Readers Integration for files";
homepage = "https://github.com/run-llama/llama_index/tree/main/llama-index-integrations/readers/llama-index-readers-file";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
} }

View File

@ -30,7 +30,12 @@
let let
# PyMuPDF needs the C++ bindings generated # PyMuPDF needs the C++ bindings generated
mupdf-cxx = mupdf.override { enableOcr = true; enableCxx = true; enablePython = true; python3 = python; }; mupdf-cxx = mupdf.override {
enableOcr = true;
enableCxx = true;
enablePython = true;
python3 = python;
};
in buildPythonPackage rec { in buildPythonPackage rec {
pname = "pymupdf"; pname = "pymupdf";
version = "1.23.26"; version = "1.23.26";
@ -45,12 +50,12 @@ in buildPythonPackage rec {
hash = "sha256-m2zq04+PDnlzFuqeSt27UhdHXTHxpHdMPIg5RQl/5bQ="; hash = "sha256-m2zq04+PDnlzFuqeSt27UhdHXTHxpHdMPIg5RQl/5bQ=";
}; };
# swig is not wrapped as python package # swig is not wrapped as Python package
# libclang calls itself just clang in wheel metadata # libclang calls itself just clang in wheel metadata
postPatch = '' postPatch = ''
substituteInPlace pyproject.toml \ substituteInPlace pyproject.toml \
--replace '"swig",' "" \ --replace-fail '"swig",' "" \
--replace "libclang" "clang" --replace-fail "libclang" "clang"
''; '';
nativeBuildInputs = [ nativeBuildInputs = [
@ -95,16 +100,79 @@ in buildPythonPackage rec {
fonttools fonttools
]; ];
preCheck = ''
export PATH="$PATH:$out/bin";
'';
disabledTests = [ disabledTests = [
# fails for indeterminate reasons # fails for indeterminate reasons
"test_color_count"
"test_2753"
"test_2548" "test_2548"
"test_2753"
"test_3020"
"test_3050"
"test_3058"
"test_3177"
"test_3186"
"test_color_count"
"test_pilsave"
"test_fz_write_pixmap_as_jpeg"
# NotImplementedError
"test_1824"
"test_2093"
"test_2093"
"test_2108"
"test_2182"
"test_2182"
"test_2246"
"test_2270"
"test_2270"
"test_2391"
"test_2788"
"test_2861"
"test_2871"
"test_2886"
"test_2904"
"test_2922"
"test_2934"
"test_2957"
"test_2969"
"test_3070"
"test_3131"
"test_3140"
"test_3209"
"test_3209"
"test_caret"
"test_deletion"
"test_file_info"
"test_line"
"test_page_links_generator"
"test_polyline"
"test_redact"
"test_techwriter_append"
"test_text2"
# Issue with FzArchive
"test_htmlbox"
"test_2246"
"test_3140"
"test_fit_springer"
"test_write_stabilized_with_links"
"test_textbox"
"test_delete_image"
# Fonts not available
"test_fontarchive"
"test_subset_fonts"
# Exclude lint tests
"test_flake8"
] ++ lib.optionals stdenv.isDarwin [ ] ++ lib.optionals stdenv.isDarwin [
# darwin does not support OCR right now # darwin does not support OCR right now
"test_tesseract" "test_tesseract"
]; ];
disabledTestPaths = [
# Issue with FzArchive
"tests/test_docs_samples.py"
];
pythonImportsCheck = [ pythonImportsCheck = [
"fitz" "fitz"
"fitz_old" "fitz_old"