From 480760bf31caf63cf84d89f41eb1a3586e631307 Mon Sep 17 00:00:00 2001 From: mauryasameer Date: Wed, 8 Apr 2026 22:21:49 +0530 Subject: [PATCH 1/2] chore: upgrade to Python 3.12, add code-review-graph, simplify CI - Rebuild venv with Python 3.12 (paddleocr has no Python 3.13 wheels) - Add code-review-graph==2.2.1 to requirements-dev.txt - Add .code-review-graph/ and *.crg.db to .gitignore - Update pyproject.toml ruff target-version to py312 - CI: pin to single Python 3.12 (remove multi-version matrix) - Fix integration test: also clear OCRFactory._instances before dynamic loading test --- .github/workflows/ci.yml | 6 +----- .gitignore | 4 ++++ pyproject.toml | 2 +- requirements-dev.txt | 1 + tests/integration/test_ocr.py | 3 ++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 337bcf8..533c06a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,16 +9,12 @@ on: jobs: test: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.11", "3.12"] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.12" cache: pip - name: Install dependencies diff --git a/.gitignore b/.gitignore index d3694fe..0881d4b 100644 --- a/.gitignore +++ b/.gitignore @@ -155,3 +155,7 @@ models/ # Runtime data (never committed) src/data/ + +# code-review-graph local graph +*.crg.db +.code-review-graph/ diff --git a/pyproject.toml b/pyproject.toml index 53be975..fb80e8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.ruff] -target-version = "py311" +target-version = "py312" line-length = 120 exclude = ["venv", ".venv", "core", "scripts"] diff --git a/requirements-dev.txt b/requirements-dev.txt index b573053..86eaa67 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,3 @@ black>=24.0.0 huggingface_hub +code-review-graph==2.2.1 diff --git a/tests/integration/test_ocr.py b/tests/integration/test_ocr.py index 261a3ce..a8f29fd 100644 --- a/tests/integration/test_ocr.py +++ b/tests/integration/test_ocr.py @@ -38,8 +38,9 @@ def test_paddle_engine_mocked_predict(): def test_easyocr_factory_dynamic_loading(): with patch("src.providers.easyocr_provider.EasyOCREngine") as mock_easy: - # Reset registry so easyocr is not cached from a previous test + # Reset registry and instance cache so easyocr is not cached from a previous test OCRFactory._engines.pop("easyocr", None) + OCRFactory._instances.pop("easyocr", None) OCRFactory.get_engine("easyocr") mock_easy.assert_called_once() From 75c65fd0e219475199626d4d631cde43300bafcd Mon Sep 17 00:00:00 2001 From: mauryasameer Date: Wed, 8 Apr 2026 22:30:11 +0530 Subject: [PATCH 2/2] fix(ci): remove matrix from deploy gate, pin to Python 3.12 --- .github/workflows/deploy_hf_space.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy_hf_space.yml b/.github/workflows/deploy_hf_space.yml index f0795ec..8baea46 100644 --- a/.github/workflows/deploy_hf_space.yml +++ b/.github/workflows/deploy_hf_space.yml @@ -8,16 +8,13 @@ jobs: # ── Gate: all tests must pass before deploy ────────────────────────────── test: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.11", "3.12"] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.12" cache: pip - name: Install test dependencies