Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ LABEL \
maintainer="https://ocr-d.de/kontakt" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/bertsky/ocrd_wrap" \
org.label-schema.build-date=$BUILD_DATE
org.label-schema.build-date=$BUILD_DATE \
org.opencontainers.image.vendor="DFG-Funded Initiative for Optical Character Recognition Development" \
org.opencontainers.image.title="ocrd_wrap" \
org.opencontainers.image.description="arbitrary coords-preserving image operations" \
org.opencontainers.image.source="https://github.com/bertsky/ocrd_wrap" \
org.opencontainers.image.documentation="https://github.com/bertsky/ocrd_wrap/blob/${VCS_REF}/README.md" \
org.opencontainers.image.revision=$VCS_REF \
org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.base.name=ocrd/core

WORKDIR /build/ocrd_wrap
COPY setup.py .
COPY ocrd_wrap/ocrd-tool.json .
COPY ocrd_wrap ./ocrd_wrap
COPY requirements.txt .
COPY README.md .
COPY Makefile .
RUN make install
RUN rm -rf /build/ocrd_wrap
COPY . .
# prepackage ocrd-tool.json as ocrd-all-tool.json
RUN ocrd ocrd-tool ocrd_wrap/ocrd-tool.json dump-tools > $(dirname $(ocrd bashlib filename))/ocrd-all-tool.json
# install everything and reduce image size
RUN make install && rm -rf /build/ocrd_wrap

WORKDIR /data
VOLUME ["/data"]
VOLUME /data
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PYTHON = python3
PIP = pip3
PYTHONIOENCODING=utf8

DOCKER_BASE_IMAGE = docker.io/ocrd/core:v3.0.3
DOCKER_BASE_IMAGE = docker.io/ocrd/core:v3.1.0
DOCKER_TAG = ocrd/wrap

help:
Expand Down Expand Up @@ -67,4 +67,4 @@ docker:
--build-arg BUILD_DATE=$$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
-t $(DOCKER_TAG) .

.PHONY: help deps deps-test install install-dev test docker
.PHONY: help deps deps-test install install-dev build test docker
96 changes: 96 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
[build-system]
requires = ["setuptools>=61.0.0", "wheel", "setuptools-ocrd"]

[project]
name = "ocrd_wrap"
authors = [
{name = "Robert Sachunsky", email = "sachunsky@informatik.uni-leipzig.de"},
]
description = "OCR-D wrapper for arbitrary coords-preserving image operations"
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.8"
keywords = ["ocr", "ocr-d", "scikit-image"]

dynamic = ["version", "dependencies", "optional-dependencies"]

# https://pypi.org/classifiers/
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Science/Research",
"Intended Audience :: Other Audience",
"License :: OSI Approved :: MIT Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Text Processing",
]

[project.scripts]
ocrd-preprocess-image = "ocrd_wrap.cli:ocrd_preprocess_image"
ocrd-skimage-normalize = "ocrd_wrap.cli:ocrd_skimage_normalize"
ocrd-skimage-denoise-raw = "ocrd_wrap.cli:ocrd_skimage_denoise_raw"
ocrd-skimage-denoise = "ocrd_wrap.cli:ocrd_skimage_denoise"
ocrd-skimage-binarize = "ocrd_wrap.cli:ocrd_skimage_binarize"

[project.urls]
Homepage = "https://github.com/bertsky/ocrd_wrap"
Repository = "https://github.com/bertsky/ocrd_wrap.git"


[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
optional-dependencies.test = {file = ["requirements_test.txt"]}

[tool.setuptools]
packages = ["ocrd_wrap"]
package-data = {"*" = ["*.json"]}

[tool.pytest.ini_options]
minversion = 6.0
addopts = "--strict-markers"
markers = [
"integration: integration tests",
]


[tool.mypy]
plugins = ["numpy.typing.mypy_plugin"]

ignore_missing_imports = true


strict = true

disallow_subclassing_any = false
# ❗ error: Class cannot subclass "Processor" (has type "Any")
disallow_any_generics = false
disallow_untyped_defs = false
disallow_untyped_calls = false


[tool.ruff.lint]
select = ["E", "F", "I"]


[tool.coverage.run]
branch = true
source = [
"ocrd_wrap"
]
concurrency = [
"thread",
"multiprocessing"
]

[tool.coverage.report]
exclude_also = [
"if self\\.debug",
"pragma: no cover",
"raise NotImplementedError",
"if __name__ == .__main__.:",
]
ignore_errors = true
omit = [
"ocrd_wrap/cli.py"
]
46 changes: 0 additions & 46 deletions setup.py

This file was deleted.