Gaetan Lepage
2026-08-04 23:14:14 +00:00
parent 3e796f8ef4
commit 2e9401879a

View File

@@ -3,92 +3,131 @@
stdenv,
buildPythonPackage,
fetchFromGitHub,
pythonAtLeast,
pythonOlder,
# build-system
hatchling,
poetry-core,
# dependencies
docling,
pydantic-settings,
typer,
boto3,
pandas,
fastparquet,
pyarrow,
docling-slim,
httpx,
pandas,
pydantic-settings,
# optional dependencies
ray,
# optional-dependencies
# rq:
rq,
msgpack,
# ray:
redis,
psutil,
ray,
# gdrive:
google-api-python-client,
google-auth-oauthlib,
# gcloudstorage:
google-cloud-storage,
# azure:
azure-storage-blob,
# opensearch:
opensearch-py,
# tests
pytestCheckHook,
aiohttp,
pytest-asyncio,
pytestCheckHook,
starlette,
redisTestHook,
writableTmpDirAsHomeHook,
}:
buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
pname = "docling-jobkit";
version = "1.8.1";
version = "3.2.0";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "docling-project";
repo = "docling-jobkit";
tag = "v${version}";
hash = "sha256-9DzQY/XMmx/8XP1bMYZYl+Bp7AVcYfuv3MtO6lvQ/24=";
tag = "v${finalAttrs.version}";
hash = "sha256-4OUNDn90jGWqHcs9QPpOKqYnKDxH+N/YUeszY21nhMo=";
};
build-system = [
hatchling
poetry-core
];
dependencies = [
docling
pydantic-settings
typer
boto3
pandas
fastparquet
pyarrow
httpx
pythonRelaxDeps = [
"pandas"
];
dependencies = [
boto3
docling-slim
httpx
pandas
pydantic-settings
]
++ docling-slim.optional-dependencies.standard;
optional-dependencies = {
ray = [ ray ];
vlm = docling-slim.optional-dependencies.models-vlm-inline;
rq = [
rq
msgpack
];
ray = [
msgpack
psutil
ray
]
++ ray.optional-dependencies.serve
++ redis.optional-dependencies.hiredis
++ lib.optionals ((pythonAtLeast "3.11") && (pythonOlder "3.14")) [
# cloudflare-sdk
];
gdrive = [
google-api-python-client
google-auth-oauthlib
];
gcloudstorage = [
google-cloud-storage
];
azure = [
azure-storage-blob
];
opensearch = [
opensearch-py
];
};
pythonRelaxDeps = [
"boto3"
"pandas"
"pyarrow"
];
pythonImportsCheck = [
"docling"
"docling_jobkit"
];
nativeCheckInputs = [
pytestCheckHook
aiohttp
pytest-asyncio
pytestCheckHook
ray
redisTestHook
starlette
writableTmpDirAsHomeHook
]
++ optional-dependencies.rq;
++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies;
disabledTests = [
# requires network access
"test_chunk_file"
"test_chunker_manager_shared_across_workers"
"test_clear_converters_clears_caches"
"test_convert_file"
"test_convert_warmup"
"test_convert_url"
"test_convert_warmup"
"test_convert_with_callbacks"
"test_replicated_convert"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
@@ -98,10 +137,10 @@ buildPythonPackage rec {
];
meta = {
changelog = "https://github.com/docling-project/docling-jobkit/blob/${src.tag}/CHANGELOG.md";
description = "Running a distributed job processing documents with Docling";
homepage = "https://github.com/docling-project/docling-jobkit";
changelog = "https://github.com/docling-project/docling-jobkit/blob/${finalAttrs.src.tag}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ codgician ];
};
}
})