Skip to content

Commit 9262698

Browse files
authored
Merge pull request #5 from MehmedGIT/port-to-v3
Port to ocrd core version 3.0.0
2 parents db65d7f + ed8082c commit 9262698

30 files changed

+1369
-1824
lines changed

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test ocrd_cis installation and run tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
15+
os: [ "ubuntu-22.04" ]
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
ref: ${{ github.head_ref }}
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- uses: actions/setup-java@v4
27+
with:
28+
distribution: 'zulu'
29+
java-version: '11'
30+
- name: Install ocrd_cis
31+
run: make install
32+
- name: Test ocrd_cis
33+
run: make test V=

Makefile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ PIP ?= pip3
33
V ?= > /dev/null 2>&1
44
PKG = ocrd_cis
55
TAG = flobar/ocrd_cis
6+
SHELL = bash
67

78
install:
89
${PIP} install --upgrade pip .
@@ -20,9 +21,26 @@ docker-push: docker-build
2021
docker push $(TAG):latest
2122

2223
TEST_SCRIPTS=$(sort $(filter-out tests/run_training_test.bash, $(wildcard tests/run_*.bash)))
24+
INDENT != MAX=; for NAME in $(TEST_SCRIPTS:tests/%=%); do if test $${\#MAX} -lt $${\#NAME}; then MAX=$${NAME//?/_}; fi; done; echo $$MAX
25+
indent = `WHAT=$1; WITH=$(INDENT); echo $$WHAT$${WITH:$${\#WHAT}}`
26+
format_tr = "$(call indent,$1):\t%U\t%S\t%E\t%P\t(%Mk)"
27+
format_th = "$(call indent)\tuser\tsystem\telapsed\tCPU\tmaxRSS"
28+
2329
.PHONY: $(TEST_SCRIPTS)
2430
$(TEST_SCRIPTS):
25-
bash $@ $V
31+
OCRD_MAX_PARALLEL_PAGES=1 /usr/bin/time -o test_serially.log -a -f $(call format_tr,$(@F)) bash -x $@ $V
32+
OCRD_MAX_PARALLEL_PAGES=4 /usr/bin/time -o test_parallel.log -a -f $(call format_tr,$(@F)) bash -x $@ $V
33+
34+
test: export OCRD_OVERRIDE_LOGLEVEL=DEBUG
35+
test: export OCRD_MISSING_OUTPUT=ABORT
36+
test: export OCRD_MAX_MISSING_OUTPUTS=-1
2637
test: $(TEST_SCRIPTS)
27-
@echo $^
38+
@echo =====single-processing test results=====
39+
@echo -e $(call format_th)
40+
@cat test_serially.log
41+
@echo =====4-page-parallel test results=====
42+
@echo -e $(call format_th)
43+
@cat test_parallel.log
44+
@$(RM) test_serially.log test_parallel.log
45+
2846
.PHONY: install install-devel uninstall test docker-build docker-push

ocrd_cis/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
from .javaprocess import JavaAligner
22
from .javaprocess import JavaPostCorrector
3-
from .ocrd_tool import get_ocrd_tool

0 commit comments

Comments
 (0)