diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 34ad79f..04db230 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -13,14 +13,14 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python: ["3.10", "3.11", "3.12"] + python: ["3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v7 - name: Set up Python uses: actions/setup-python@v6 with: # MacOS issue ref.: https://github.com/actions/setup-python/issues/855 & https://github.com/actions/setup-python/issues/865 - python-version: ${{ matrix.os == 'macos-latest' && matrix.python == '3.10' && '3.11' || matrix.python }} + python-version: ${{ matrix.python }} architecture: x64 # MacOS: use crnn_vgg16_bn as recognition architecture to avoid onnxruntime error - name: Set recognition arch for macOS @@ -34,6 +34,6 @@ jobs: - name: Install package run: | python -m pip install --upgrade pip - pip install -e . --upgrade + pip install -e .[cpu] --upgrade - name: Import package run: python -c "import labeler; print(labeler.__version__)" \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8524e93..267aa4a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,14 +12,13 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python: ["3.10", "3.11", "3.12"] + python: ["3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v7 - name: Set up Python uses: actions/setup-python@v6 with: - # MacOS issue ref.: https://github.com/actions/setup-python/issues/855 & https://github.com/actions/setup-python/issues/865 - python-version: ${{ matrix.os == 'macos-latest' && matrix.python == '3.10' && '3.11' || matrix.python }} + python-version: ${{ matrix.python }} architecture: x64 # MacOS: use crnn_vgg16_bn as recognition architecture to avoid onnxruntime error - name: Set recognition arch for macOS diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d020995..22368bd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v7 @@ -49,7 +49,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 36583fe..76bf712 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python @@ -31,7 +31,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python: ["3.10"] + python: ["3.11"] steps: - uses: actions/checkout@v7 - name: Set up Python diff --git a/.gitignore b/.gitignore index 315e076..aa85f92 100644 --- a/.gitignore +++ b/.gitignore @@ -125,6 +125,9 @@ venv.bak/ .dmypy.json dmypy.json +# ruff +.ruff_cache/ + # Pyre type checker .pyre/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c72ec2f..c5c920a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: - id: no-commit-to-branch args: ['--branch', 'main'] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.0 + rev: v0.15.22 hooks: - id: ruff args: [ --fix ] diff --git a/README.md b/README.md index 00da0ac..c06730a 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,13 @@ Python 3.10 (or higher) and [pip](https://pip.pypa.io/en/stable/) are required t ### Latest release -You can then install the latest release of the package using [pypi](https://pypi.org/project/OnnxTR/) as follows: +You can then install the latest release of the package using [pypi](https://pypi.org/project/doctr-labeler/) as follows: ```bash -pip3 install doctr-labeler +# Install the CPU version +pip3 install "doctr-labeler[cpu]" +# Or with GPU support +pip3 install "doctr-labeler[gpu]" ``` ## Keybindings diff --git a/pyproject.toml b/pyproject.toml index 4a65827..1e81a56 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ maintainers = [ {name = "Felix Dittrich"}, ] readme = "README.md" -requires-python = ">=3.10.0,<4" +requires-python = ">=3.11.0,<4" license = {file = "LICENSE"} keywords=["OCR", "document processing", "labeling", "annotation", "docTR", "OnnxTR"] classifiers=[ @@ -22,26 +22,21 @@ classifiers=[ "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering", ] dynamic = ["version"] dependencies = [ "numpy>=1.16.0, <3.0.0", - "opencv-python>=4.5.0, <5.0.0", + "opencv-python>=4.5.0, <6.0.0", "Pillow>=9.2.0", "tqdm>=4.30.0", "huggingface-hub>=0.23.0,<2.0.0", # GUI "sv-ttk>=2.6.0", "darkdetect>=0.8.0", - # AutoML - # Linux & Windows - "onnxtr[gpu]>=0.6.0, <1.0.0; sys_platform != 'darwin'", - # MacOS compatibility - "onnxtr[cpu]>=0.6.0, <1.0.0; sys_platform == 'darwin'", ] [project.scripts] @@ -69,7 +64,12 @@ dev = [ "ruff>=0.1.5", "mypy>=0.812", "pre-commit>=2.17.0", + # AutoML + "onnxtr[cpu]>=0.6.0, <1.0.0", ] +# AutoML +cpu = ["onnxtr[cpu]>=0.6.0, <1.0.0"] +gpu = ["onnxtr[gpu]>=0.6.0, <1.0.0"] [project.urls] repository = "https://github.com/text2knowledge/docTR-Labeler" @@ -113,7 +113,7 @@ ignore_missing_imports = true [tool.ruff] exclude = [".git", "venv*", "build", "**/__init__.py"] line-length = 120 -target-version = "py310" +target-version = "py311" preview=true [tool.ruff.lint] diff --git a/setup.py b/setup.py index 6b69aae..e8926b5 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup PKG_NAME = "doctr-labeler" -VERSION = os.getenv("BUILD_VERSION", "0.3.1") +VERSION = os.getenv("BUILD_VERSION", "0.4.0") if __name__ == "__main__":