Skip to content

Commit

Permalink
Merge branch 'rl-0.11.0-RC02'
Browse files Browse the repository at this point in the history
  • Loading branch information
amenezes committed Oct 23, 2023
2 parents 5a4d45e + 5ff468d commit a06c9e4
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[run]
branch = True
omit = **__init__.py**
**__main__.py
omit = *__init__.py*
*__main__.py*

[report]
show_missing = True
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
tests:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', 'pypy-3.8', 'pypy-3.9']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9']
os: [ubuntu]
fail-fast: true
runs-on: ${{ matrix.os }}-latest
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python 3.12.0
23 changes: 17 additions & 6 deletions aiopytesseract/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
from .commands import (confidence, deskew, get_languages,
get_tesseract_version, image_to_boxes, image_to_data,
image_to_hocr, image_to_osd, image_to_pdf,
image_to_string, languages, run, tesseract_parameters,
tesseract_version)
from .commands import (
confidence,
deskew,
get_languages,
get_tesseract_version,
image_to_boxes,
image_to_data,
image_to_hocr,
image_to_osd,
image_to_pdf,
image_to_string,
languages,
run,
tesseract_parameters,
tesseract_version,
)
from .models import OSD, Box, Data, Parameter

__version__ = "0.10.0"
__version__ = "0.11.0"
__all__ = [
"__version__",
"OSD",
Expand Down
12 changes: 7 additions & 5 deletions aiopytesseract/base_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
from typing import Any, List, Optional, Tuple

from ._logger import logger
from .constants import (AIOPYTESSERACT_DEFAULT_ENCODING,
AIOPYTESSERACT_DEFAULT_TIMEOUT, OUTPUT_FILE_EXTENSIONS,
TESSERACT_CMD)
from .constants import (
AIOPYTESSERACT_DEFAULT_ENCODING,
AIOPYTESSERACT_DEFAULT_TIMEOUT,
OUTPUT_FILE_EXTENSIONS,
TESSERACT_CMD,
)
from .exceptions import TesseractRuntimeError, TesseractTimeoutError
from .returncode import ReturnCode
from .validators import (file_exists, language_is_valid, oem_is_valid,
psm_is_valid)
from .validators import file_exists, language_is_valid, oem_is_valid, psm_is_valid


async def execute_cmd(cmd_args: str, timeout: float = AIOPYTESSERACT_DEFAULT_TIMEOUT):
Expand Down
11 changes: 7 additions & 4 deletions aiopytesseract/validators.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from pathlib import Path

from .constants import (OCR_ENGINE_MODES, PAGE_SEGMENTATION_MODES,
TESSERACT_LANGUAGES)
from .exceptions import (LanguageInvalidException, NoSuchFileException,
OEMInvalidException, PSMInvalidException)
from .constants import OCR_ENGINE_MODES, PAGE_SEGMENTATION_MODES, TESSERACT_LANGUAGES
from .exceptions import (
LanguageInvalidException,
NoSuchFileException,
OEMInvalidException,
PSMInvalidException,
)


async def psm_is_valid(psm: int) -> None:
Expand Down
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = asyncio tesseract wrapper for Tesseract-OCR
long_description = file: README.md
long_description_content_type = text/markdown
license = Apache-2.0
license_file = LICENSE
license_files = LICENSE
url = https://github.com/amenezes/aiopytesseract
project_urls =
Documentation = https://github.com/amenezes/aiopytesseract
Expand All @@ -28,6 +28,7 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Topic :: Software Development :: Libraries
Expand Down Expand Up @@ -78,7 +79,7 @@ warn_unused_ignores = True
warn_unreachable = True

[tox:tox]
envlist = py{38,39,310,311},pypy{3.8,3.9}
envlist = py{38,39,310,311,312},pypy{3.8,3.9}

[testenv]
deps = -rrequirements-dev.txt
Expand Down

0 comments on commit a06c9e4

Please sign in to comment.