Commit Graph

25 Commits

Author SHA1 Message Date
alexpolo1
3d11947bf2 ocr: bundle Tesseract into release for click-and-run OCR
Make the standalone exe work with OCR out of the box — no separate
Tesseract install, no tesserocr DLL hell. Verified end-to-end: built the
exe, ran it frozen with the system Tesseract blinded, confirmed it
resolves the bundled binary and reads text ("CHAM RUNE").

- ocr.py: resolve an _APP_BASE (exe dir when frozen, else cwd) and prefer
  a bundled <exe_dir>/tesseract/tesseract.exe over PATH / Program Files.
  Resolve assets/tessdata to an absolute path so OCR no longer depends on
  the current working dir. Applies to both the tesserocr and pytesseract
  paths.
- build.py: copy a portable Tesseract (exe + DLLs) from TESSERACT_DIR
  (default C:\Program Files\Tesseract-OCR) into <release>/tesseract/. Our
  trained models in assets/tessdata are used via --tessdata-dir, so their
  tessdata is skipped. Warns (non-fatal) if Tesseract isn't present.
- ci.yml: choco install tesseract before the build so the bundle is
  reproducible on the runner; verify it landed in the release dir.
- test/conftest.py: apply the SSL cert-store workaround so pytest can be
  collected on Windows boxes with a corrupted cert store (no-op on CI).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 10:49:25 +02:00
alexpolo1
73c4601e2b ci: tag-triggered build-and-release in one run
Switch from the upload-to-an-existing-release model (create release in
UI/CLI first, release:published triggers CI) to a tag-driven flow:

  git tag v0.8.5 && git push --tags
  -> CI builds + smoke-tests both exes
  -> softprops/action-gh-release creates the release and attaches the zip

Build fails => no release is ever created (no more empty/half-published
releases). Removes the release: trigger so the workflow can't double-fire
when the action publishes the release. Keeps permissions: contents: write.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 10:25:17 +02:00
alexpolo1
5647f323a7 ci: grant contents:write so release upload step can attach the zip
The build job's "Upload to Release" step failed with HTTP 403
"Resource not accessible by integration" because the default
GITHUB_TOKEN is read-only. Add top-level permissions: contents: write.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 10:12:44 +02:00
alexpolo1
57073946ae ci: split test job into named steps, fix coverage xml phantom-file error
- Split monolithic 'Validate Botty' into 4 named steps so failures are
  visible per-step without log diving: Python version / Syntax check /
  Tests / Coverage report
- Add scripts/ to compileall so new scripts are syntax-checked too
- Add -v to pytest for per-test pass/fail in CI output
- Fix coverage xml exiting 1 on conda phantom config-3.py:
  - Move ignore_errors to [report] section (was wrongly in [xml])
  - Add --ignore-errors flag on coverage xml command (belt+suspenders)
  - Omit config-3.py and site-packages paths from [run] tracking

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-20 09:34:11 +02:00
alex
f1d6c6bd1c ci: align validation environment with Windows 11 2026-06-07 18:31:10 +02:00
alex
d0ecf3afdc ci: run full Botty validation 2026-06-07 18:19:24 +02:00
alex
b9f3253e24 fix(ci): restore test assets from git history, remove dead download step
- Restore test/assets/ from commit 5127417^ (was moved to bottytools/botty-test-assets which is now 404)
- Remove 'Download test assets' step from CI workflow (assets are now in-repo)
- Make download_test_assets.py a no-op for backward compatibility
- Fix import: from pipes import Template -> from template_finder import Template
- Remove test/assets/ from .gitignore
2026-05-30 10:03:11 +02:00
alex
4b339228fe fix(ci): merge coverage into pytest step to fix Coverage failure 2026-05-30 09:41:50 +02:00
alex
d44acf8bf2 Add CI launch smoke test for built executables 2026-05-25 13:47:09 +02:00
alex
40a207be9a feat: harden install.bat + add CI checks for launcher scripts
install.bat:
- Add conda self-test (conda --version) before env create
- Verify botty python.exe exists after env creation
- Smoke-test key imports (cv2, tesserocr, discord, etc.)

CI (.github/workflows/ci.yml):
- Add test_setup_bat_files.py to test matrix

test/test_setup_bat_files.py (7 tests):
- All expected .bat files exist
- No hardcoded usernames (alex, alexpolo, ultimate) in run scripts
- No absolute home paths in run scripts (must use %~dp0 / %USERNAME%)
- All run_*.bat source find_python.bat (no duplicated conda detection)
- find_python.bat checks >= 6 conda locations
- install.bat has conda self-test and python verification
2026-05-23 23:15:24 +02:00
alex
6c261c3cbb fix fuzzy matching bug and CI coverage collection
find_best_match was using extractOne (which maximises its scorer) with
Levenshtein distance (lower = better), so it returned the worst match
instead of the best. Switch to extract+min to correctly minimise distance.
Fixes 6 failing tests in test_text_correction.py.

CI: run pytest under `coverage run` so coverage.xml has data to report;
drop deprecated use-only-tar-bz2 flag from setup-miniconda steps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 23:53:15 +02:00
alex
416b6714dd fix CI: add PYTHONPATH=./src to all steps 2026-05-22 23:31:27 +02:00
alex
ab29fa0a46 fix release bundle: main.exe naming, full zip with config+assets, add release trigger 2026-05-22 23:28:21 +02:00
alex
77d84680c6 fix CI: remove broken pytest-pythonpath, add test→build pipeline, fix test asset guards 2026-05-22 23:24:41 +02:00
mgleed
3e6f9a9bf1 Migrate from Python 3.9 to 3.10 (#826)
* migrate from python 3.9 to 3.10, recompiled tesserocr

* cleanup old types, change all Unions to |

* add a few match/case statements

* Update ci.yml

Co-authored-by: aeon0 <aeon4@pm.me>
2022-06-05 08:01:28 -04:00
aeon0
7564fea4b0 Remove: Codecov (#632)
* Remove: Codecov

* test commit

* revert test commit

Co-authored-by: uidn4233 <johannes.dobler@continental-corporation.com>
2022-03-12 22:21:14 -05:00
aeon0
27f0e3d793 Revert "Add Linting (#487)" (#490)
This reverts commit 5e1a783394.
2022-01-28 18:24:47 +01:00
aeon0
5e1a783394 Add Linting (#487)
* add black linting

* fix linting

* doc update
2022-01-28 17:47:03 +01:00
aeon0
39dd868a34 Fix testing (#437)
* test

* with coverage

* add back coverage

* actually fixing test

* ups typo
2022-01-12 19:52:26 +01:00
aeon0
7eef36c2df Add Tests and Coverage report (#341) 2021-12-28 14:40:28 +01:00
aeon0
1d7fcbafca Update release process (#161)
* Update release process

* update ci
2021-12-01 17:53:46 +01:00
aeon0
8501fe1114 update ci.yml 2021-11-15 20:31:23 +01:00
aeon0
2c7bb42907 make action trigger on PR 2021-11-14 11:56:40 +01:00
aeon0
2b018a7f65 rename workflow 2021-11-14 11:53:00 +01:00
aeon0
810a76aba7 Setting up CI (#22) 2021-11-14 11:25:11 +01:00