mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2025-06-26 23:49:59 +00:00
203 lines
4.5 KiB
TOML
203 lines
4.5 KiB
TOML
# SPDX-FileCopyrightText: 2022 James R. Barlow
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
[build-system]
|
|
requires = [
|
|
"setuptools >= 61",
|
|
"setuptools_scm[toml] >= 7.0.5",
|
|
"wheel"
|
|
]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "ocrmypdf"
|
|
dynamic = ["version"]
|
|
description = "OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched"
|
|
readme = "README.md"
|
|
license = {text = "MPL-2.0"}
|
|
requires-python = ">=3.8"
|
|
dependencies = [
|
|
"Pillow>=8.2.0",
|
|
"coloredlogs>=14.0",
|
|
"deprecation>=2.1.0",
|
|
"img2pdf>=0.3.0", # pure Python
|
|
"packaging>=20",
|
|
"pdfminer.six>=20201018",
|
|
"pikepdf>=5.0.1",
|
|
"pluggy>=0.13.0",
|
|
"reportlab>=3.5.66",
|
|
"tqdm>=4",
|
|
"importlib-resources>=5;python_version<'3.9'", # until Python 3.9
|
|
"typing-extensions>=4;python_version<'3.10'",
|
|
]
|
|
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",
|
|
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
|
|
"Operating System :: MacOS :: MacOS X",
|
|
"Operating System :: Microsoft :: Windows :: Windows 10",
|
|
"Operating System :: POSIX",
|
|
"Operating System :: POSIX :: BSD",
|
|
"Operating System :: POSIX :: Linux",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3 :: Only",
|
|
"Programming Language :: Python :: 3.8",
|
|
"Programming Language :: Python :: 3.9",
|
|
"Programming Language :: Python :: 3.10",
|
|
"Topic :: Scientific/Engineering :: Image Recognition",
|
|
"Topic :: Text Processing :: Indexing",
|
|
"Topic :: Text Processing :: Linguistic",
|
|
]
|
|
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"
|
|
|
|
[project.optional-dependencies]
|
|
docs = ["sphinx", "sphinx-issues", "sphinx-rtd-theme"]
|
|
extended_test = ["PyMuPDF==1.19.1"]
|
|
test = [
|
|
"coverage[toml]>=5",
|
|
"pytest>=6.0.0",
|
|
"pytest-cov>=2.11.1",
|
|
"pytest-xdist>=2.2.0",
|
|
"python-xmp-toolkit==2.0.1", # also requires apt-get install libexempi3
|
|
"types-Pillow",
|
|
"types-humanfriendly",
|
|
]
|
|
watcher = ["watchdog>=1.0.2"]
|
|
webservice = ["Flask>=1"]
|
|
|
|
[project.scripts]
|
|
ocrmypdf = "ocrmypdf.__main__:run"
|
|
|
|
[tool.setuptools.package-data]
|
|
ocrmypdf = ["data/sRGB.icc", "py.typed"]
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["src"]
|
|
namespaces = false
|
|
|
|
[tool.setuptools_scm]
|
|
|
|
[tool.distutils.bdist_wheel]
|
|
python-tag = "py38"
|
|
|
|
[tool.black]
|
|
line-length = 88
|
|
target-version = ["py38", "py39", "py310", "py311"]
|
|
skip-string-normalization = true
|
|
include = '\.pyi?$'
|
|
exclude = '''
|
|
/(
|
|
\.eggs
|
|
| \.git
|
|
| \.hg
|
|
| \.mypy_cache
|
|
| \.tox
|
|
| \.venv
|
|
| _build
|
|
| buck-out
|
|
| build
|
|
| dist
|
|
| docs
|
|
| misc
|
|
| \.egg-info
|
|
)/
|
|
'''
|
|
|
|
[tool.coverage.run]
|
|
branch = true
|
|
parallel = true
|
|
concurrency = ["multiprocessing"]
|
|
|
|
[tool.coverage.paths]
|
|
source = ["src/ocrmypdf"]
|
|
|
|
[tool.coverage.report]
|
|
# Regexes for lines to exclude from consideration
|
|
exclude_lines = [
|
|
# 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__.:",
|
|
"if TYPE_CHECKING:"
|
|
]
|
|
|
|
[tool.isort]
|
|
profile = "black"
|
|
known_first_party = "ocrmypdf"
|
|
known_third_party = [
|
|
"PIL",
|
|
"flask",
|
|
"img2pdf",
|
|
"ocrmypdf",
|
|
"pdfminer",
|
|
"pikepdf",
|
|
"pkg_resources",
|
|
"pluggy",
|
|
"pytest",
|
|
"reportlab",
|
|
"setuptools",
|
|
"sphinx_rtd_theme",
|
|
"tqdm",
|
|
"watchdog",
|
|
"werkzeug"
|
|
]
|
|
|
|
[tool.pytest.ini_options]
|
|
minversion = "6.0"
|
|
norecursedirs = ["lib", ".pc", ".git", "venv", "output", "cache", "resources"]
|
|
testpaths = ["tests"]
|
|
addopts = "-n auto"
|
|
markers = ["slow"]
|
|
filterwarnings = ["ignore:.*XMLParser.*:DeprecationWarning"]
|
|
|
|
[tool.mypy]
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = [
|
|
'pluggy',
|
|
'tqdm',
|
|
'coloredlogs',
|
|
'img2pdf',
|
|
'pdfminer.*',
|
|
'reportlab.*',
|
|
'fitz',
|
|
'libxmp.utils'
|
|
]
|
|
ignore_missing_imports = true
|
|
|
|
[tool.ruff]
|
|
select = [
|
|
"D", # pydocstyle
|
|
"E", # pycodestyle
|
|
"W", # pycodestyle
|
|
"F", # pyflakes
|
|
"I001", # isort
|
|
"UP", # pyupgrade
|
|
]
|
|
target-version = "py38"
|
|
|
|
[tool.ruff.isort]
|
|
known-first-party = ["ocrmypdf"]
|
|
required-imports = ["from __future__ import annotations"]
|
|
|
|
[tool.ruff.pydocstyle]
|
|
convention = "google" |