From 84b844203d7a1cb27fccefd19dee2869b0abe3b2 Mon Sep 17 00:00:00 2001 From: kba Date: Thu, 29 Aug 2024 17:11:29 +0200 Subject: [PATCH] switch from qurator namespace to src-layout --- ocrd-tool.json | 2 +- pyproject.toml | 6 +++--- qurator/.gitkeep | 0 {qurator => src}/eynollah/__init__.py | 0 {qurator => src}/eynollah/cli.py | 2 +- {qurator => src}/eynollah/eynollah.py | 0 {qurator => src}/eynollah/ocrd-tool.json | 0 {qurator => src}/eynollah/ocrd_cli.py | 0 {qurator => src}/eynollah/plot.py | 0 {qurator => src}/eynollah/processor.py | 0 {qurator => src}/eynollah/utils/__init__.py | 0 {qurator => src}/eynollah/utils/contour.py | 0 {qurator => src}/eynollah/utils/counter.py | 0 {qurator => src}/eynollah/utils/drop_capitals.py | 0 {qurator => src}/eynollah/utils/is_nan.py | 0 {qurator => src}/eynollah/utils/marginals.py | 0 {qurator => src}/eynollah/utils/pil_cv2.py | 0 {qurator => src}/eynollah/utils/resize.py | 0 {qurator => src}/eynollah/utils/rotate.py | 0 {qurator => src}/eynollah/utils/separate_lines.py | 0 {qurator => src}/eynollah/utils/xml.py | 0 {qurator => src}/eynollah/writer.py | 0 tests/test_counter.py | 2 +- tests/test_dpi.py | 2 +- tests/test_run.py | 2 +- tests/test_smoke.py | 12 ++++++------ tests/test_xml.py | 2 +- 27 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 qurator/.gitkeep rename {qurator => src}/eynollah/__init__.py (100%) rename {qurator => src}/eynollah/cli.py (99%) rename {qurator => src}/eynollah/eynollah.py (100%) rename {qurator => src}/eynollah/ocrd-tool.json (100%) rename {qurator => src}/eynollah/ocrd_cli.py (100%) rename {qurator => src}/eynollah/plot.py (100%) rename {qurator => src}/eynollah/processor.py (100%) rename {qurator => src}/eynollah/utils/__init__.py (100%) rename {qurator => src}/eynollah/utils/contour.py (100%) rename {qurator => src}/eynollah/utils/counter.py (100%) rename {qurator => src}/eynollah/utils/drop_capitals.py (100%) rename {qurator => src}/eynollah/utils/is_nan.py (100%) rename {qurator => src}/eynollah/utils/marginals.py (100%) rename {qurator => src}/eynollah/utils/pil_cv2.py (100%) rename {qurator => src}/eynollah/utils/resize.py (100%) rename {qurator => src}/eynollah/utils/rotate.py (100%) rename {qurator => src}/eynollah/utils/separate_lines.py (100%) rename {qurator => src}/eynollah/utils/xml.py (100%) rename {qurator => src}/eynollah/writer.py (100%) diff --git a/ocrd-tool.json b/ocrd-tool.json index 5c48493..711a192 120000 --- a/ocrd-tool.json +++ b/ocrd-tool.json @@ -1 +1 @@ -qurator/eynollah/ocrd-tool.json \ No newline at end of file +src/eynollah/ocrd-tool.json \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 8f9f175..67a420d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,8 +26,8 @@ classifiers = [ ] [project.scripts] -eynollah = "qurator.eynollah.cli:main" -ocrd-eynollah-segment = "qurator.eynollah.ocrd_cli:main" +eynollah = "eynollah.cli:main" +ocrd-eynollah-segment = "eynollah.ocrd_cli:main" [project.urls] Homepage = "https://github.com/qurator-spk/eynollah" @@ -37,7 +37,7 @@ Repository = "https://github.com/qurator-spk/eynollah.git" dependencies = {file = ["requirements.txt"]} [tool.setuptools.packages.find] -where = ["qurator"] +where = ["src"] [tool.setuptools.package-data] "*" = ["*.json", '*.yml', '*.xml', '*.xsd'] diff --git a/qurator/.gitkeep b/qurator/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/qurator/eynollah/__init__.py b/src/eynollah/__init__.py similarity index 100% rename from qurator/eynollah/__init__.py rename to src/eynollah/__init__.py diff --git a/qurator/eynollah/cli.py b/src/eynollah/cli.py similarity index 99% rename from qurator/eynollah/cli.py rename to src/eynollah/cli.py index 822db18..d61928f 100644 --- a/qurator/eynollah/cli.py +++ b/src/eynollah/cli.py @@ -1,7 +1,7 @@ import sys import click from ocrd_utils import initLogging, setOverrideLogLevel -from qurator.eynollah.eynollah import Eynollah +from eynollah.eynollah import Eynollah @click.command() diff --git a/qurator/eynollah/eynollah.py b/src/eynollah/eynollah.py similarity index 100% rename from qurator/eynollah/eynollah.py rename to src/eynollah/eynollah.py diff --git a/qurator/eynollah/ocrd-tool.json b/src/eynollah/ocrd-tool.json similarity index 100% rename from qurator/eynollah/ocrd-tool.json rename to src/eynollah/ocrd-tool.json diff --git a/qurator/eynollah/ocrd_cli.py b/src/eynollah/ocrd_cli.py similarity index 100% rename from qurator/eynollah/ocrd_cli.py rename to src/eynollah/ocrd_cli.py diff --git a/qurator/eynollah/plot.py b/src/eynollah/plot.py similarity index 100% rename from qurator/eynollah/plot.py rename to src/eynollah/plot.py diff --git a/qurator/eynollah/processor.py b/src/eynollah/processor.py similarity index 100% rename from qurator/eynollah/processor.py rename to src/eynollah/processor.py diff --git a/qurator/eynollah/utils/__init__.py b/src/eynollah/utils/__init__.py similarity index 100% rename from qurator/eynollah/utils/__init__.py rename to src/eynollah/utils/__init__.py diff --git a/qurator/eynollah/utils/contour.py b/src/eynollah/utils/contour.py similarity index 100% rename from qurator/eynollah/utils/contour.py rename to src/eynollah/utils/contour.py diff --git a/qurator/eynollah/utils/counter.py b/src/eynollah/utils/counter.py similarity index 100% rename from qurator/eynollah/utils/counter.py rename to src/eynollah/utils/counter.py diff --git a/qurator/eynollah/utils/drop_capitals.py b/src/eynollah/utils/drop_capitals.py similarity index 100% rename from qurator/eynollah/utils/drop_capitals.py rename to src/eynollah/utils/drop_capitals.py diff --git a/qurator/eynollah/utils/is_nan.py b/src/eynollah/utils/is_nan.py similarity index 100% rename from qurator/eynollah/utils/is_nan.py rename to src/eynollah/utils/is_nan.py diff --git a/qurator/eynollah/utils/marginals.py b/src/eynollah/utils/marginals.py similarity index 100% rename from qurator/eynollah/utils/marginals.py rename to src/eynollah/utils/marginals.py diff --git a/qurator/eynollah/utils/pil_cv2.py b/src/eynollah/utils/pil_cv2.py similarity index 100% rename from qurator/eynollah/utils/pil_cv2.py rename to src/eynollah/utils/pil_cv2.py diff --git a/qurator/eynollah/utils/resize.py b/src/eynollah/utils/resize.py similarity index 100% rename from qurator/eynollah/utils/resize.py rename to src/eynollah/utils/resize.py diff --git a/qurator/eynollah/utils/rotate.py b/src/eynollah/utils/rotate.py similarity index 100% rename from qurator/eynollah/utils/rotate.py rename to src/eynollah/utils/rotate.py diff --git a/qurator/eynollah/utils/separate_lines.py b/src/eynollah/utils/separate_lines.py similarity index 100% rename from qurator/eynollah/utils/separate_lines.py rename to src/eynollah/utils/separate_lines.py diff --git a/qurator/eynollah/utils/xml.py b/src/eynollah/utils/xml.py similarity index 100% rename from qurator/eynollah/utils/xml.py rename to src/eynollah/utils/xml.py diff --git a/qurator/eynollah/writer.py b/src/eynollah/writer.py similarity index 100% rename from qurator/eynollah/writer.py rename to src/eynollah/writer.py diff --git a/tests/test_counter.py b/tests/test_counter.py index 8ef0756..42bf074 100644 --- a/tests/test_counter.py +++ b/tests/test_counter.py @@ -1,5 +1,5 @@ from tests.base import main -from qurator.eynollah.utils.counter import EynollahIdCounter +from eynollah.utils.counter import EynollahIdCounter def test_counter_string(): c = EynollahIdCounter() diff --git a/tests/test_dpi.py b/tests/test_dpi.py index 510ffc5..3376bf4 100644 --- a/tests/test_dpi.py +++ b/tests/test_dpi.py @@ -1,6 +1,6 @@ import cv2 from pathlib import Path -from qurator.eynollah.utils.pil_cv2 import check_dpi +from eynollah.utils.pil_cv2 import check_dpi from tests.base import main def test_dpi(): diff --git a/tests/test_run.py b/tests/test_run.py index b1137e7..2596dad 100644 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -2,7 +2,7 @@ from os import environ from pathlib import Path from ocrd_utils import pushd_popd from tests.base import CapturingTestCase as TestCase, main -from qurator.eynollah.cli import main as eynollah_cli +from eynollah.cli import main as eynollah_cli testdir = Path(__file__).parent.resolve() diff --git a/tests/test_smoke.py b/tests/test_smoke.py index d069479..252213f 100644 --- a/tests/test_smoke.py +++ b/tests/test_smoke.py @@ -1,7 +1,7 @@ def test_utils_import(): - import qurator.eynollah.utils - import qurator.eynollah.utils.contour - import qurator.eynollah.utils.drop_capitals - import qurator.eynollah.utils.drop_capitals - import qurator.eynollah.utils.is_nan - import qurator.eynollah.utils.rotate + import eynollah.utils + import eynollah.utils.contour + import eynollah.utils.drop_capitals + import eynollah.utils.drop_capitals + import eynollah.utils.is_nan + import eynollah.utils.rotate diff --git a/tests/test_xml.py b/tests/test_xml.py index 8422fd1..09a6ddf 100644 --- a/tests/test_xml.py +++ b/tests/test_xml.py @@ -1,5 +1,5 @@ from pytest import main -from qurator.eynollah.utils.xml import create_page_xml +from eynollah.utils.xml import create_page_xml from ocrd_models.ocrd_page import to_xml PAGE_2019 = 'http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15'