Files
ocrmypdf/pyproject.toml
T

176 lines
4.6 KiB
TOML
Raw Normal View History

# SPDX-FileCopyrightText: 2022 James R. Barlow
# SPDX-License-Identifier: MPL-2.0
2019-02-26 12:23:33 -08:00
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
2019-02-26 12:23:33 -08:00
[project]
name = "ocrmypdf"
dynamic = ["version"]
description = "OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched"
readme = "README.md"
2025-04-06 01:07:25 -07:00
license = "MPL-2.0"
requires-python = ">=3.11"
dependencies = [
"deprecation>=2.1.0",
"fpdf2>=2.8.0",
2023-12-20 12:33:18 -08:00
"img2pdf>=0.5",
"packaging>=20",
2023-09-19 14:42:42 -07:00
"pdfminer.six>=20220319",
2026-01-13 01:50:57 -08:00
"pi-heif", # Heif image format - maintainers: if this is removed, it will NOT break
"pikepdf>=10",
2024-04-07 00:33:13 -07:00
"Pillow>=10.0.1",
2023-12-20 12:33:18 -08:00
"pluggy>=1",
2025-12-07 14:38:38 -08:00
"pydantic>=2.12.5",
"pypdfium2>=5.0.0",
2023-06-03 00:29:26 -07:00
"rich>=13",
"uharfbuzz>=0.53.2",
]
2022-08-06 03:05:12 -07:00
authors = [{ name = "James R. Barlow", email = "james@purplerock.ca" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
2023-05-22 23:37:42 -07:00
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: POSIX :: BSD",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Image Recognition",
"Topic :: Text Processing :: Indexing",
"Topic :: Text Processing :: Linguistic",
]
2022-08-06 03:05:12 -07:00
keywords = ["PDF", "OCR", "optical character recognition", "PDF/A", "scanning"]
[project.urls]
Documentation = "https://ocrmypdf.readthedocs.io/"
Source = "https://github.com/ocrmypdf/OCRmyPDF"
Tracker = "https://github.com/ocrmypdf/OCRmyPDF/issues"
2025-11-17 07:10:48 +00:00
Changelog = "https://github.com/ocrmypdf/OCRmyPDF/docs/release_notes.md"
[project.optional-dependencies]
# User-installable features - use `uv sync --extra <name>` or `pip install ocrmypdf[name]`
watcher = ["watchdog>=1.0.2", "cyclopts>=3", "python-dotenv"]
2025-02-26 14:53:13 -08:00
webservice = ["streamlit>=1.41.0"]
[project.scripts]
ocrmypdf = "ocrmypdf.__main__:run"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "src/ocrmypdf/_version.py"
2021-06-09 00:47:39 -07:00
[tool.distutils.bdist_wheel]
python-tag = "py311"
2021-08-17 01:43:02 -07:00
[tool.coverage.run]
branch = true
parallel = true
2023-10-17 01:58:37 -07:00
concurrency = ["multiprocessing", "thread"]
sigterm = true
2021-08-17 01:43:02 -07:00
[tool.coverage.paths]
source = ["src/ocrmypdf"]
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
2021-12-06 12:32:27 -08:00
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if False:",
"if __name__ == .__main__.:",
2022-08-06 03:05:12 -07:00
"if TYPE_CHECKING:",
2021-08-17 01:43:02 -07:00
]
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = ["tests"]
addopts = "-n auto"
markers = ["slow"]
2024-02-12 01:17:08 -08:00
filterwarnings = [
"ignore:.*XMLParser.*:DeprecationWarning",
2024-02-12 01:43:47 -08:00
"ignore:.*ast.NameConstant.*:DeprecationWarning:reportlab",
"ignore:.*distutils.*:DeprecationWarning:libxmp",
2024-02-12 01:17:08 -08:00
]
2021-09-14 17:22:41 -07:00
[tool.mypy]
[[tool.mypy.overrides]]
module = [
2021-12-06 12:32:27 -08:00
'pluggy',
'img2pdf',
'pdfminer.*',
'reportlab.*',
'fitz',
2022-08-06 03:05:12 -07:00
'libxmp.utils',
2021-09-14 17:22:41 -07:00
]
ignore_missing_imports = true
2022-06-11 01:15:30 -07:00
2023-04-14 00:19:17 -07:00
[tool.ruff]
target-version = "py311"
exclude = ["src/ocrmypdf/_version.py"] # Autogenerated
2024-02-14 12:32:26 -08:00
[tool.ruff.lint]
"select" = [
2026-01-13 01:50:57 -08:00
"D", # pydocstyle
"E", # pycodestyle
"W", # pycodestyle
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"SIM", # simplify
"B", # flake8-bugbear
]
ignore = [
"B028", # warning with no explicit stacklevel
# rule is key in dict instead of key in dict.keys(); but pikepdf semantics differ
"SIM118",
2023-04-14 00:38:34 -07:00
]
2024-02-14 12:32:26 -08:00
[tool.ruff.lint.isort]
2023-04-14 00:38:34 -07:00
known-first-party = ["ocrmypdf"]
2023-04-14 00:19:17 -07:00
2024-02-14 12:32:26 -08:00
[tool.ruff.lint.pydocstyle]
2023-04-14 01:23:57 -07:00
convention = "google"
2024-02-14 12:32:26 -08:00
[tool.ruff.lint.per-file-ignores]
2023-04-14 01:23:57 -07:00
"docs/conf.py" = ["D100", "D101", "D105"]
"tests/*.py" = ["D100", "D101", "D102", "D103", "D105"]
2023-04-14 02:14:12 -07:00
"misc/*.py" = ["D103", "D101", "D102"]
2022-08-06 03:05:12 -07:00
"src/ocrmypdf/builtin_plugins/*.py" = ["D103", "D102", "D105"]
2024-04-07 00:25:32 -07:00
[tool.ruff.format]
quote-style = "preserve"
[dependency-groups]
# Developer-only tools - use `uv sync --group <name>`
2026-01-13 01:50:57 -08:00
dev = ["mypy>=1.13.0", "ipykernel>=6.29.5"]
test = [
# Core testing framework
"coverage[toml]>=6.2",
"hypothesis>=6.36.0",
"pytest>=6.2.5",
"pytest-cov>=3.0.0",
"pytest-xdist>=2.5.0",
# Test dependencies
"python-xmp-toolkit==2.0.1", # also requires apt-get install libexempi3
"reportlab>=3.6.8",
# Type stubs for testing
"types-Pillow",
"types-humanfriendly",
# Extended test capabilities (merged from extended_test)
"pymupdf>=1.24.14",
]
docs = ["myst-parser>=4.0.1", "sphinx", "sphinx-issues", "sphinx-rtd-theme", "sphinxcontrib-mermaid"]
2026-01-13 01:50:57 -08:00
streamlit-dev = ["streamlit>=1.40.2", "streamlit-pdf-viewer>=0.0.19"]