Skip to content

Commit 48a8386

Browse files
authored
python312Packages.docling-core: add semchunk dependency (#379628)
2 parents e2879eb + bd76037 commit 48a8386

File tree

6 files changed

+222
-3
lines changed

6 files changed

+222
-3
lines changed

pkgs/development/python-modules/docling-core/default.nix

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
pydantic,
1212
tabulate,
1313
pyyaml,
14+
semchunk,
1415
typing-extensions,
1516
transformers,
1617
typer,
@@ -46,7 +47,7 @@ buildPythonPackage rec {
4647
pyyaml
4748
typing-extensions
4849
transformers
49-
# semchunk
50+
semchunk
5051
typer
5152
latex2mathml
5253
];
@@ -60,14 +61,17 @@ buildPythonPackage rec {
6061
"docling_core"
6162
];
6263

63-
doCheck = false;
64-
6564
nativeCheckInputs = [
6665
jsondiff
6766
pytestCheckHook
6867
requests
6968
];
7069

70+
disabledTestPaths = [
71+
# attempts to download models
72+
"test/test_hybrid_chunker.py"
73+
];
74+
7175
meta = {
7276
changelog = "https://github.com/DS4SD/docling-core/blob/${src.tag}/CHANGELOG.md";
7377
description = "Python library to define and validate data types in Docling";
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
fetchFromGitHub,
5+
setuptools,
6+
wheel,
7+
importlib-resources,
8+
pygments,
9+
tqdm,
10+
flask,
11+
multiprocess,
12+
docutils,
13+
sphinx,
14+
sphinx-autodoc-typehints,
15+
sphinx-rtd-theme,
16+
sphinx-versions,
17+
sphinxcontrib-images,
18+
ipywidgets,
19+
numpy,
20+
rich,
21+
pytestCheckHook,
22+
}:
23+
24+
buildPythonPackage rec {
25+
pname = "mpire";
26+
version = "2.10.2";
27+
pyproject = true;
28+
29+
src = fetchFromGitHub {
30+
owner = "sybrenjansen";
31+
repo = "mpire";
32+
tag = "v${version}";
33+
hash = "sha256-6O+k8gSMCu4zhj7KzbsC5UUCU/TG/g3dYsGVuvcy25E=";
34+
};
35+
36+
build-system = [
37+
setuptools
38+
wheel
39+
];
40+
41+
dependencies = [
42+
importlib-resources
43+
pygments
44+
tqdm
45+
];
46+
47+
optional-dependencies = {
48+
dashboard = [
49+
flask
50+
];
51+
dill = [
52+
multiprocess
53+
];
54+
docs = [
55+
docutils
56+
sphinx
57+
sphinx-autodoc-typehints
58+
sphinx-rtd-theme
59+
sphinx-versions
60+
sphinxcontrib-images
61+
];
62+
testing = [
63+
ipywidgets
64+
multiprocess
65+
numpy
66+
rich
67+
];
68+
};
69+
70+
pythonImportsCheck = [
71+
"mpire"
72+
];
73+
74+
nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.testing;
75+
76+
pytestFlagsArray = [ "tests" ];
77+
78+
meta = {
79+
description = "A Python package for easy multiprocessing, but faster than multiprocessing";
80+
homepage = "https://pypi.org/project/mpire/";
81+
license = lib.licenses.mit;
82+
maintainers = with lib.maintainers; [ booxter ];
83+
};
84+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
fetchPypi,
5+
hatchling,
6+
mpire,
7+
tqdm,
8+
}:
9+
10+
buildPythonPackage rec {
11+
pname = "semchunk";
12+
version = "3.0.1";
13+
pyproject = true;
14+
15+
src = fetchPypi {
16+
inherit pname version;
17+
hash = "sha256-UP9nHLHGYNZm5eXHfNufDYhd9pPvrmp3HcVUFAjcAZw=";
18+
};
19+
20+
build-system = [
21+
hatchling
22+
];
23+
24+
dependencies = [
25+
mpire
26+
tqdm
27+
];
28+
29+
pythonImportsCheck = [
30+
"semchunk"
31+
];
32+
33+
meta = {
34+
description = "A fast, lightweight and easy-to-use Python library for splitting text into semantically meaningful chunks";
35+
homepage = "https://pypi.org/project/semchunk/";
36+
license = lib.licenses.mit;
37+
maintainers = with lib.maintainers; [ booxter ];
38+
};
39+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
fetchPypi,
5+
setuptools,
6+
wheel,
7+
click,
8+
colorclass,
9+
sphinx,
10+
}:
11+
12+
buildPythonPackage rec {
13+
pname = "sphinx-versions";
14+
version = "1.1.3";
15+
pyproject = true;
16+
17+
src = fetchPypi {
18+
inherit pname version;
19+
hash = "sha256-9ROFEjET+d2Dfg4DHx0IqUN34oGwY4AGbi7teK4YmR8=";
20+
};
21+
22+
build-system = [
23+
setuptools
24+
wheel
25+
];
26+
27+
dependencies = [
28+
click
29+
colorclass
30+
sphinx
31+
];
32+
33+
pythonImportsCheck = [
34+
"sphinxcontrib.versioning"
35+
];
36+
37+
meta = {
38+
description = "Sphinx extension that allows building versioned docs for self-hosting";
39+
homepage = "https://pypi.org/project/sphinx-versions/";
40+
license = lib.licenses.mit;
41+
maintainers = with lib.maintainers; [ booxter ];
42+
};
43+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
lib,
3+
buildPythonPackage,
4+
fetchPypi,
5+
setuptools,
6+
wheel,
7+
requests,
8+
sphinx,
9+
}:
10+
11+
buildPythonPackage rec {
12+
pname = "sphinxcontrib-images";
13+
version = "0.9.4";
14+
pyproject = true;
15+
16+
src = fetchPypi {
17+
inherit pname version;
18+
hash = "sha256-9sI30EMHk+ZdkdvdsTsfsmos+DgECp3utSESlp+8Sks=";
19+
};
20+
21+
build-system = [
22+
setuptools
23+
wheel
24+
];
25+
26+
dependencies = [
27+
requests
28+
sphinx
29+
];
30+
31+
pythonImportsCheck = [
32+
"sphinxcontrib.images"
33+
];
34+
35+
meta = {
36+
description = "Sphinx extension for thumbnails";
37+
homepage = "https://pypi.org/project/sphinxcontrib-images/";
38+
license = lib.licenses.asl20;
39+
maintainers = with lib.maintainers; [ booxter ];
40+
};
41+
}

pkgs/top-level/python-packages.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8556,6 +8556,8 @@ self: super: with self; {
85568556

85578557
mpi4py = callPackage ../development/python-modules/mpi4py { };
85588558

8559+
mpire = callPackage ../development/python-modules/mpire { };
8560+
85598561
mpldatacursor = callPackage ../development/python-modules/mpldatacursor { };
85608562

85618563
mplcursors = callPackage ../development/python-modules/mplcursors { };
@@ -14763,6 +14765,8 @@ self: super: with self; {
1476314765

1476414766
semantic-version = callPackage ../development/python-modules/semantic-version { };
1476514767

14768+
semchunk = callPackage ../development/python-modules/semchunk { };
14769+
1476614770
semgrep = callPackage ../development/python-modules/semgrep {
1476714771
semgrep-core = callPackage ../development/python-modules/semgrep/semgrep-core.nix { };
1476814772
};
@@ -15375,6 +15379,8 @@ self: super: with self; {
1537515379

1537615380
sphinx-comments = callPackage ../development/python-modules/sphinx-comments { };
1537715381

15382+
sphinxcontrib-images = callPackage ../development/python-modules/sphinxcontrib-images { };
15383+
1537815384
sphinx-design = callPackage ../development/python-modules/sphinx-design { };
1537915385

1538015386
sphinx-external-toc = callPackage ../development/python-modules/sphinx-external-toc { };
@@ -15407,6 +15413,8 @@ self: super: with self; {
1540715413

1540815414
sphinx-togglebutton = callPackage ../development/python-modules/sphinx-togglebutton { };
1540915415

15416+
sphinx-versions = callPackage ../development/python-modules/sphinx-versions { };
15417+
1541015418
sphinxawesome-theme = callPackage ../development/python-modules/sphinxawesome-theme { };
1541115419

1541215420
sphinxcontrib-actdiag = callPackage ../development/python-modules/sphinxcontrib-actdiag { };

0 commit comments

Comments
 (0)