Skip to content

Commit 654129a

Browse files
rmitschRaphael Mitsch
andauthored
Fix install issues (#88)
* Fix install issues by (1) adding setup.py and (2) making all dependencies mandatory. * Fix import in tests. --------- Co-authored-by: Raphael Mitsch <[email protected]>
1 parent 922f65f commit 654129a

File tree

4 files changed

+22
-38
lines changed

4 files changed

+22
-38
lines changed

pyproject.toml

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,10 @@ license = { text = "MIT" }
1010
dynamic = ["version", "authors"]
1111
requires-python = ">=3.10"
1212
dependencies = [
13-
"loguru>=0.7.3"
14-
]
15-
classifiers = [
16-
"Development Status :: 3 - Alpha",
17-
"Intended Audience :: Developers",
18-
"Topic :: Software Development :: Libraries",
19-
"License :: OSI Approved :: MIT License",
20-
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.11",
22-
"Programming Language :: Python :: 3.12"
23-
]
24-
25-
[project.optional-dependencies]
26-
all = [
13+
"loguru>=0.7.3",
14+
"pydantic>=2,<3",
15+
"datasets>=3,<4",
16+
"jinja2>=3,<4",
2717
"chonkie>=0.3",
2818
"docling>=2",
2919
"outlines>=0.0.34",
@@ -40,24 +30,20 @@ all = [
4030
"unstructured-inference>=0.8,<1",
4131
"instructor>=1,<2",
4232
]
33+
classifiers = [
34+
"Development Status :: 3 - Alpha",
35+
"Intended Audience :: Developers",
36+
"Topic :: Software Development :: Libraries",
37+
"License :: OSI Approved :: MIT License",
38+
"Programming Language :: Python :: 3",
39+
"Programming Language :: Python :: 3.11",
40+
"Programming Language :: Python :: 3.12"
41+
]
42+
43+
[project.optional-dependencies]
4344
utils = [
44-
"chonkie>=0.3",
45-
"docling>=2",
46-
"unstructured[all-docs]>=0.16,<1",
47-
"unstructured-inference>=0.8,<1",
4845
"tesseract>=0.1,<1"
4946
]
50-
engines = [
51-
"outlines>=0.0.34",
52-
"dspy-ai>=2,<3",
53-
"transformers>=4,<5",
54-
"sentencepiece<1",
55-
"gliner<1",
56-
"ollama<1",
57-
"langchain>=0.3,<0.4",
58-
"scikit-learn>=1,<2",
59-
"instructor>=1,<2",
60-
]
6147
test = [
6248
"pytest>=7.4.3",
6349
"pytest-cov>=4.1.0",

setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env python
2+
3+
if __name__ == "__main__":
4+
from setuptools import find_packages, setup
5+
6+
setup(name="spacy-llm", packages=find_packages())

sieves/data/doc.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ def __post_init__(self) -> None:
2020
if self.chunks is None and self.text is not None:
2121
self.chunks = [self.text]
2222

23-
@property
24-
def __str__(self) -> str: # type: ignore[override]
25-
"""Returns document text.
26-
:return str: Document text or empty string if no text.
27-
"""
28-
return self.text if self.text else ""
29-
3023
def __eq__(self, other: object) -> bool:
3124
if not isinstance(other, Doc):
3225
raise NotImplementedError

sieves/tests/tasks/test_classification.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# mypy: ignore-errors
22
import enum
33

4-
import engines
54
import pytest
65

7-
from sieves import Doc, Pipeline
6+
from sieves import Doc, Pipeline, engines
87
from sieves.engines import EngineType
98
from sieves.tasks import PredictiveTask
109
from sieves.tasks.predictive import classification

0 commit comments

Comments
 (0)