Files
kg-scr/pyproject.toml
Aman Nalakath c5bf5d2b0c
Some checks failed
tests / core (macos-latest, py3.11) (push) Has been cancelled
tests / core (macos-latest, py3.12) (push) Has been cancelled
tests / core (macos-latest, py3.13) (push) Has been cancelled
tests / core (ubuntu-latest, py3.11) (push) Has been cancelled
tests / core (ubuntu-latest, py3.12) (push) Has been cancelled
tests / core (ubuntu-latest, py3.13) (push) Has been cancelled
tests / doctor CLI smoke test (push) Has been cancelled
remove notebooks
- Delete notebooks/ (personal scratch artifacts; gitignored)
- Move nbformat to --extra migrate; lazy imports in migrate.py and
  cli.py so base CLI loads without it
- Restore langchain-text-splitters in core (chunking dependency)
2026-07-21 00:47:52 +02:00

181 lines
3.8 KiB
TOML

[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"
[project]
name = "ocr-pipeline"
version = "0.2.0"
description = "OCR pipeline for life science screenshots - RAG ready"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
# Core
"typer[all]>=0.9.0",
"pydantic>=2.6.0",
"pydantic-settings>=2.2.0",
"pyyaml>=6.0.1",
"structlog>=24.1.0",
"rich>=13.7.0",
# Image processing
"opencv-python-headless>=4.9.0,<5.0.0",
"pillow>=10.2.0",
"numpy>=1.26.0,<2.0; python_version < '3.12'",
"numpy>=1.26.0; python_version >= '3.12'",
"pytesseract>=0.3.10",
# File watching
"watchdog>=3.0.0",
# Utilities
"platformdirs>=4.2.0",
"langchain-text-splitters>=0.0.2",
]
[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.12.0",
"ruff>=0.2.0",
"mypy>=1.8.0",
"types-PyYAML>=6.0.12",
"pre-commit>=3.6.0",
]
paddle = [
"paddleocr>=2.7.0,<3.0.0",
"paddlepaddle>=2.6.0",
]
tables = [
"torch>=2.2.0",
"torchvision>=0.17.0",
"transformers>=4.38.0",
"timm>=1.0.0",
]
figures = [
"layoutparser>=0.3.0",
"legacy-cgi>=2.6.2; python_version >= '3.13'",
]
scientific = [
"spacy>=3.7.0,<3.8.0; python_version < '3.12'",
"spacy>=3.7.0; python_version >= '3.12'",
]
kg = [
"networkx>=3.2",
"txtai>=7.4.0",
"litellm>=1.40.0",
"python-dotenv>=1.0.0",
]
neo4j = [
"neo4j>=5.0",
]
migrate = [
"nbformat>=5.9.0",
]
grobid = []
full = [
"ocr-pipeline[paddle,tables,figures,scientific]",
]
[project.entry-points.console_scripts]
ocr-pipeline = "ocr_pipeline.cli:app"
[tool.setuptools.packages.find]
where = ["src", "."]
include = ["ocr_pipeline*", "kg_ocr*"]
[tool.setuptools.package-data]
ocr_pipeline = ["assets/*.png"]
[tool.uv]
dev-dependencies = [
"pytest>=8.0.0",
"pytest-cov>=4.1.0",
"pytest-mock>=3.12.0",
"ruff>=0.2.0",
"mypy>=1.8.0",
"types-PyYAML>=6.0.12",
"pre-commit>=3.6.0",
]
override-dependencies = ["lxml>=5.3.0"]
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"W", # pycodestyle warnings
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"T20", # flake8-print
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # function calls in default argument
]
fixable = ["I", "E", "W", "F"]
unfixable = ["N", "B", "C4", "T20", "UP"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "lf"
[tool.mypy]
python_version = "3.12" # numpy 2.5 stubs need >= 3.12 type-syntax
warn_return_any = true
warn_unused_configs = true
check_untyped_defs = true
no_implicit_optional = true
strict_equality = true
show_error_codes = true
pretty = true
# Optional extras: stubs unavailable or packages absent in slim installs.
[[tool.mypy.overrides]]
module = [
"paddleocr",
"paddle",
"torch",
"torchvision",
"transformers",
"layoutparser",
"spacy",
"pytesseract",
"cv2",
"PIL",
"txtai",
"txtai.embeddings",
"litellm",
"neo4j",
"networkx",
"watchdog",
"langchain.*",
"nbformat",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-v --tb=short"
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::UserWarning:torch",
"ignore::UserWarning:transformers",
]
[tool.pre-commit-hooks]
ruff = { id = "ruff", args = ["check", "--fix"] }
ruff-format = { id = "ruff", args = ["format"] }
mypy = { id = "mypy" }
pytest = { id = "pytest", args = ["-x"] }