obliq-ocr 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of obliq-ocr might be problematic. Click here for more details.
- obliq_ocr-0.1.0/.gitattributes +6 -0
- obliq_ocr-0.1.0/.github/ISSUE_TEMPLATE/architecture.yml +26 -0
- obliq_ocr-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +17 -0
- obliq_ocr-0.1.0/.github/ISSUE_TEMPLATE/ci.yml +30 -0
- obliq_ocr-0.1.0/.github/ISSUE_TEMPLATE/cli.yml +19 -0
- obliq_ocr-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +26 -0
- obliq_ocr-0.1.0/.github/ISSUE_TEMPLATE/testing.yml +19 -0
- obliq_ocr-0.1.0/.github/dependabot.yml +14 -0
- obliq_ocr-0.1.0/.github/labeler.yml +29 -0
- obliq_ocr-0.1.0/.github/pull_request_template.md +13 -0
- obliq_ocr-0.1.0/.github/release-drafter.yml +48 -0
- obliq_ocr-0.1.0/.github/workflows/autolabel.yml +21 -0
- obliq_ocr-0.1.0/.github/workflows/ci.yml +143 -0
- obliq_ocr-0.1.0/.github/workflows/docs.yml +84 -0
- obliq_ocr-0.1.0/.github/workflows/gitleaks.yml +39 -0
- obliq_ocr-0.1.0/.github/workflows/link-checker.yml +47 -0
- obliq_ocr-0.1.0/.github/workflows/pr-title.yml +36 -0
- obliq_ocr-0.1.0/.github/workflows/release-drafter.yml +60 -0
- obliq_ocr-0.1.0/.github/workflows/release.yml +102 -0
- obliq_ocr-0.1.0/.gitignore +112 -0
- obliq_ocr-0.1.0/.lychee.toml +16 -0
- obliq_ocr-0.1.0/.pre-commit-config.yaml +32 -0
- obliq_ocr-0.1.0/BENCHMARK.md +229 -0
- obliq_ocr-0.1.0/CHANGELOG.md +24 -0
- obliq_ocr-0.1.0/HOW_TO_SETUP.md +46 -0
- obliq_ocr-0.1.0/MODEL_CARD.md +190 -0
- obliq_ocr-0.1.0/Makefile +20 -0
- obliq_ocr-0.1.0/PKG-INFO +209 -0
- obliq_ocr-0.1.0/README.md +165 -0
- obliq_ocr-0.1.0/SECURITY.md +11 -0
- obliq_ocr-0.1.0/docs/HOTFIX_PROCESS.md +32 -0
- obliq_ocr-0.1.0/docs/README.md +14 -0
- obliq_ocr-0.1.0/docs/RELEASE_GUIDE.md +40 -0
- obliq_ocr-0.1.0/docs/VERSIONING_POLICY.md +18 -0
- obliq_ocr-0.1.0/docs/YANK_AND_ROLLBACK.md +42 -0
- obliq_ocr-0.1.0/docs/api.md +44 -0
- obliq_ocr-0.1.0/docs/architecture.md +209 -0
- obliq_ocr-0.1.0/docs/benchmark-memory.svg +17 -0
- obliq_ocr-0.1.0/docs/benchmark-processed-latency.svg +18 -0
- obliq_ocr-0.1.0/docs/benchmark-processed-quality.svg +24 -0
- obliq_ocr-0.1.0/docs/benchmark-scanned-latency.svg +17 -0
- obliq_ocr-0.1.0/docs/benchmark_validations/benchmark-memory.svg +17 -0
- obliq_ocr-0.1.0/docs/benchmark_validations/benchmark-processed-latency.svg +18 -0
- obliq_ocr-0.1.0/docs/benchmark_validations/benchmark-processed-quality.svg +24 -0
- obliq_ocr-0.1.0/docs/benchmark_validations/benchmark-scanned-latency.svg +17 -0
- obliq_ocr-0.1.0/docs/index.md +1 -0
- obliq_ocr-0.1.0/docs/model-card.md +1 -0
- obliq_ocr-0.1.0/mkdocs.yml +71 -0
- obliq_ocr-0.1.0/mkdocs_hooks.py +16 -0
- obliq_ocr-0.1.0/pyproject.toml +164 -0
- obliq_ocr-0.1.0/src/obliq_ocr/__init__.py +43 -0
- obliq_ocr-0.1.0/src/obliq_ocr/__main__.py +6 -0
- obliq_ocr-0.1.0/src/obliq_ocr/_version.py +24 -0
- obliq_ocr-0.1.0/src/obliq_ocr/cli.py +91 -0
- obliq_ocr-0.1.0/src/obliq_ocr/core.py +240 -0
- obliq_ocr-0.1.0/src/obliq_ocr/engine.py +122 -0
- obliq_ocr-0.1.0/src/obliq_ocr/parser.py +238 -0
- obliq_ocr-0.1.0/src/obliq_ocr/py.typed +0 -0
- obliq_ocr-0.1.0/src/obliq_ocr/schemas.py +154 -0
- obliq_ocr-0.1.0/src/obliq_ocr/utils.py +181 -0
- obliq_ocr-0.1.0/test_drafter.txt +3 -0
- obliq_ocr-0.1.0/tests/__init__.py +1 -0
- obliq_ocr-0.1.0/tests/benchmark.py +826 -0
- obliq_ocr-0.1.0/tests/conftest.py +138 -0
- obliq_ocr-0.1.0/tests/fixtures/README.md +41 -0
- obliq_ocr-0.1.0/tests/scripts/benchmark_performance.py +94 -0
- obliq_ocr-0.1.0/tests/scripts/evaluate_accuracy.py +84 -0
- obliq_ocr-0.1.0/tests/scripts/generate_fixtures.py +99 -0
- obliq_ocr-0.1.0/tests/scripts/model_card_probe.py +164 -0
- obliq_ocr-0.1.0/tests/test_accuracy.py +42 -0
- obliq_ocr-0.1.0/tests/test_performance.py +39 -0
- obliq_ocr-0.1.0/tests/test_pipeline.py +471 -0
- obliq_ocr-0.1.0/tests/test_readme.py +38 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Architecture & Refactoring
|
|
2
|
+
description: Propose architectural changes, structural refactoring, or engine updates.
|
|
3
|
+
title: "[Arch]: "
|
|
4
|
+
labels: ["type:refactoring", "needs-triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
id: arch-summary
|
|
8
|
+
attributes:
|
|
9
|
+
label: Problem / Context
|
|
10
|
+
description: Describe the current architectural limitation, technical debt, or bottleneck.
|
|
11
|
+
validations:
|
|
12
|
+
required: true
|
|
13
|
+
- type: textarea
|
|
14
|
+
id: proposed-architecture
|
|
15
|
+
attributes:
|
|
16
|
+
label: Proposed Architecture & Modules
|
|
17
|
+
description: Outline the structural changes (e.g., core engine decoupling, ONNX session pooling, PyMuPDF interface changes).
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: breaking-changes
|
|
22
|
+
attributes:
|
|
23
|
+
label: Breaking Changes & Compatibility
|
|
24
|
+
description: List any potential breaking changes to public APIs or internal module contracts.
|
|
25
|
+
validations:
|
|
26
|
+
required: false
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: File a bug report to help us improve obliq-OCR.
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: ["type:bug"]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
attributes:
|
|
8
|
+
label: Description
|
|
9
|
+
description: A clear and concise description of what the bug is.
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
attributes:
|
|
14
|
+
label: Reproduction / Steps to Reproduce
|
|
15
|
+
description: Share sample code snippet or document properties (digital vs scanned).
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: CI / Tooling Update
|
|
2
|
+
description: Request or propose updates to GitHub Actions workflows, linting, packaging, or pre-commit hooks.
|
|
3
|
+
title: "[CI]: "
|
|
4
|
+
labels: ["type:ci", "needs-triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
id: ci-description
|
|
8
|
+
attributes:
|
|
9
|
+
label: Overview
|
|
10
|
+
description: Describe the workflow change, quality gate, matrix update, or security scan to be added/modified.
|
|
11
|
+
validations:
|
|
12
|
+
required: true
|
|
13
|
+
- type: dropdown
|
|
14
|
+
id: ci-category
|
|
15
|
+
attributes:
|
|
16
|
+
label: Category
|
|
17
|
+
options:
|
|
18
|
+
- GitHub Actions Workflow
|
|
19
|
+
- Pre-commit Hooks / Ruff / Mypy
|
|
20
|
+
- Packaging (Hatch / Hatch-vcs / Build)
|
|
21
|
+
- Security & Dependency Scanning
|
|
22
|
+
validations:
|
|
23
|
+
required: true
|
|
24
|
+
- type: textarea
|
|
25
|
+
id: verification-plan
|
|
26
|
+
attributes:
|
|
27
|
+
label: Verification & Test Plan
|
|
28
|
+
description: How should this CI workflow change be tested and validated?
|
|
29
|
+
validations:
|
|
30
|
+
required: true
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: CLI Feature or Issue
|
|
2
|
+
description: Report bugs or request enhancements specifically related to the obliq-OCR command-line interface.
|
|
3
|
+
title: "[CLI]: "
|
|
4
|
+
labels: ["cli", "needs-triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
id: cli-summary
|
|
8
|
+
attributes:
|
|
9
|
+
label: Summary
|
|
10
|
+
description: Describe the CLI feature request, argument change, or behavior bug.
|
|
11
|
+
validations:
|
|
12
|
+
required: true
|
|
13
|
+
- type: textarea
|
|
14
|
+
id: command-example
|
|
15
|
+
attributes:
|
|
16
|
+
label: Command Execution & Expected Output
|
|
17
|
+
description: Provide the exact `obliq-ocr ...` command invocation and expected terminal output.
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Propose a new feature, enhancement, or capability for obliq-OCR.
|
|
3
|
+
title: "[Feat]: "
|
|
4
|
+
labels: ["type:feature", "needs-triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
id: feature-description
|
|
8
|
+
attributes:
|
|
9
|
+
label: Feature Description
|
|
10
|
+
description: A clear and concise description of what you want to achieve or add.
|
|
11
|
+
validations:
|
|
12
|
+
required: true
|
|
13
|
+
- type: textarea
|
|
14
|
+
id: use-case
|
|
15
|
+
attributes:
|
|
16
|
+
label: Use Case & Motivation
|
|
17
|
+
description: Why is this feature needed? What problem does it solve for users or downstream workflows?
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: proposed-solution
|
|
22
|
+
attributes:
|
|
23
|
+
label: Proposed Implementation / Design
|
|
24
|
+
description: Optional detailed description of how this could be implemented (API surface, modules, or dependencies).
|
|
25
|
+
validations:
|
|
26
|
+
required: false
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Testing & Test Fixtures
|
|
2
|
+
description: Propose new test suites, synthetic PDF fixture enhancements, or coverage additions.
|
|
3
|
+
title: "[Test]: "
|
|
4
|
+
labels: ["type:test", "needs-triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
id: test-gap
|
|
8
|
+
attributes:
|
|
9
|
+
label: Testing Scope / Gap
|
|
10
|
+
description: Identify missing test scenarios, uncovered modules, or edge-case PDF fixtures needing validation.
|
|
11
|
+
validations:
|
|
12
|
+
required: true
|
|
13
|
+
- type: textarea
|
|
14
|
+
id: implementation-details
|
|
15
|
+
attributes:
|
|
16
|
+
label: Test Implementation Details
|
|
17
|
+
description: Describe how synthetic PDF fixtures or unit/integration tests should be constructed under `tests/`.
|
|
18
|
+
validations:
|
|
19
|
+
required: false
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "pip"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
open-pull-requests-limit: 10
|
|
8
|
+
reviewers:
|
|
9
|
+
- "abhirajadhikary06"
|
|
10
|
+
|
|
11
|
+
- package-ecosystem: "github-actions"
|
|
12
|
+
directory: "/"
|
|
13
|
+
schedule:
|
|
14
|
+
interval: "weekly"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
ocr:
|
|
3
|
+
- changed-files:
|
|
4
|
+
- any-glob-to-any-file:
|
|
5
|
+
- "src/obliq_ocr/parser.py"
|
|
6
|
+
- "src/obliq_ocr/engine.py"
|
|
7
|
+
- "src/obliq_ocr/cli.py"
|
|
8
|
+
|
|
9
|
+
pdf-parsing:
|
|
10
|
+
- changed-files:
|
|
11
|
+
- any-glob-to-any-file:
|
|
12
|
+
- "src/obliq_ocr/core.py"
|
|
13
|
+
- "src/obliq_ocr/utils.py"
|
|
14
|
+
|
|
15
|
+
packaging:
|
|
16
|
+
- changed-files:
|
|
17
|
+
- any-glob-to-any-file:
|
|
18
|
+
- "pyproject.toml"
|
|
19
|
+
- "setup.py"
|
|
20
|
+
|
|
21
|
+
github_actions:
|
|
22
|
+
- changed-files:
|
|
23
|
+
- any-glob-to-any-file:
|
|
24
|
+
- ".github/workflows/**"
|
|
25
|
+
|
|
26
|
+
test:
|
|
27
|
+
- changed-files:
|
|
28
|
+
- any-glob-to-any-file:
|
|
29
|
+
- "tests/**/*.py"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
<!-- Provide a brief description of the changes introduced in this PR. -->
|
|
3
|
+
|
|
4
|
+
## Changes
|
|
5
|
+
- [ ] Bug fix / Refactoring
|
|
6
|
+
- [ ] New feature (`type:feature`)
|
|
7
|
+
- [ ] Documentation update (`type:docs`)
|
|
8
|
+
- [ ] CI / Tooling change (`type:ci`)
|
|
9
|
+
|
|
10
|
+
## Testing & Validation
|
|
11
|
+
- [ ] Passed unit and integration test suite (`pytest`)
|
|
12
|
+
- [ ] Verified performance / accuracy regression benchmarks (if applicable)
|
|
13
|
+
- [ ] Tested locally via wheel installation in a clean venv
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name-template: "v$RESOLVED_VERSION"
|
|
2
|
+
tag-template: "v$RESOLVED_VERSION"
|
|
3
|
+
|
|
4
|
+
categories:
|
|
5
|
+
- title: "💥 Breaking Changes"
|
|
6
|
+
labels:
|
|
7
|
+
- "breaking-change"
|
|
8
|
+
- "major"
|
|
9
|
+
|
|
10
|
+
- title: "🚢 New Features & Enhancements"
|
|
11
|
+
labels:
|
|
12
|
+
- "feature"
|
|
13
|
+
- "enhancement"
|
|
14
|
+
|
|
15
|
+
- title: "🦗 Bug Fixes"
|
|
16
|
+
labels:
|
|
17
|
+
- "bug"
|
|
18
|
+
- "fix"
|
|
19
|
+
|
|
20
|
+
- title: "📦 Packaging & Release"
|
|
21
|
+
labels:
|
|
22
|
+
- "packaging"
|
|
23
|
+
- "ci"
|
|
24
|
+
|
|
25
|
+
version-resolver:
|
|
26
|
+
major:
|
|
27
|
+
labels:
|
|
28
|
+
- "breaking-change"
|
|
29
|
+
- "major"
|
|
30
|
+
|
|
31
|
+
minor:
|
|
32
|
+
labels:
|
|
33
|
+
- "feature"
|
|
34
|
+
- "enhancement"
|
|
35
|
+
|
|
36
|
+
patch:
|
|
37
|
+
labels:
|
|
38
|
+
- "bug"
|
|
39
|
+
- "fix"
|
|
40
|
+
- "packaging"
|
|
41
|
+
- "ci"
|
|
42
|
+
|
|
43
|
+
default: patch
|
|
44
|
+
|
|
45
|
+
template: |
|
|
46
|
+
## Changes
|
|
47
|
+
$CHANGES
|
|
48
|
+
**Full Changelog**: $COMPARE_URL
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
name: Auto-Labeler
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
pull_request_target:
|
|
6
|
+
types: [opened, synchronize, reopened]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
label:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
pull-requests: write
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Automatically label pull requests
|
|
18
|
+
uses: actions/labeler@v7
|
|
19
|
+
with:
|
|
20
|
+
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
21
|
+
configuration-path: .github/labeler.yml
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
name: CI Quality Gates
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
paths:
|
|
7
|
+
- 'src/**'
|
|
8
|
+
- 'tests/**'
|
|
9
|
+
- 'pyproject.toml'
|
|
10
|
+
- 'Makefile'
|
|
11
|
+
- 'README.md' # tests/test_readme.py runs the quickstart
|
|
12
|
+
- '.github/workflows/ci.yml'
|
|
13
|
+
pull_request:
|
|
14
|
+
branches: [ main ]
|
|
15
|
+
paths:
|
|
16
|
+
- 'src/**'
|
|
17
|
+
- 'tests/**'
|
|
18
|
+
- 'pyproject.toml'
|
|
19
|
+
- 'Makefile'
|
|
20
|
+
- 'README.md' # tests/test_readme.py runs the quickstart
|
|
21
|
+
- '.github/workflows/ci.yml'
|
|
22
|
+
|
|
23
|
+
concurrency:
|
|
24
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
25
|
+
cancel-in-progress: true
|
|
26
|
+
|
|
27
|
+
jobs:
|
|
28
|
+
lint-and-typecheck:
|
|
29
|
+
name: Lint & Type Check
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
steps:
|
|
32
|
+
- name: Checkout Code
|
|
33
|
+
uses: actions/checkout@v4
|
|
34
|
+
|
|
35
|
+
- name: Install System Dependencies (OpenCV / OpenGL)
|
|
36
|
+
run: |
|
|
37
|
+
sudo apt-get update
|
|
38
|
+
sudo apt-get install -y libgl1 libglib2.0-0
|
|
39
|
+
|
|
40
|
+
- name: Set up Python
|
|
41
|
+
uses: actions/setup-python@v5
|
|
42
|
+
with:
|
|
43
|
+
python-version: '3.11'
|
|
44
|
+
cache: 'pip'
|
|
45
|
+
|
|
46
|
+
- name: Install Dependencies
|
|
47
|
+
run: |
|
|
48
|
+
python -m pip install --upgrade pip
|
|
49
|
+
pip install -e .[dev] ruff mypy
|
|
50
|
+
|
|
51
|
+
- name: Run Ruff Linter
|
|
52
|
+
run: ruff check .
|
|
53
|
+
|
|
54
|
+
- name: Run Ruff Formatter Check
|
|
55
|
+
run: ruff format --check --exclude src/obliq_ocr/_version.py .
|
|
56
|
+
|
|
57
|
+
- name: Run Mypy Type Check
|
|
58
|
+
run: mypy src/
|
|
59
|
+
|
|
60
|
+
test-matrix:
|
|
61
|
+
name: Test (Python ${{ matrix.python-version }})
|
|
62
|
+
needs: lint-and-typecheck
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
strategy:
|
|
65
|
+
fail-fast: false
|
|
66
|
+
matrix:
|
|
67
|
+
python-version: ['3.10', '3.11', '3.12']
|
|
68
|
+
steps:
|
|
69
|
+
- name: Checkout Code
|
|
70
|
+
uses: actions/checkout@v4
|
|
71
|
+
|
|
72
|
+
- name: Install System Dependencies (OpenCV / OpenGL)
|
|
73
|
+
run: |
|
|
74
|
+
sudo apt-get update
|
|
75
|
+
sudo apt-get install -y libgl1 libglib2.0-0
|
|
76
|
+
|
|
77
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
78
|
+
uses: actions/setup-python@v5
|
|
79
|
+
with:
|
|
80
|
+
python-version: ${{ matrix.python-version }}
|
|
81
|
+
cache: 'pip'
|
|
82
|
+
|
|
83
|
+
- name: Install Package & Test Dependencies
|
|
84
|
+
run: |
|
|
85
|
+
python -m pip install --upgrade pip
|
|
86
|
+
python -m pip install -e .[test,dev] pytest pytest-cov jiwer
|
|
87
|
+
|
|
88
|
+
- name: Generate Synthetic PDF Fixtures
|
|
89
|
+
run: python tests/scripts/generate_fixtures.py
|
|
90
|
+
|
|
91
|
+
- name: Run Pytest Suite with Coverage
|
|
92
|
+
run: python -m pytest --cov=obliq_ocr
|
|
93
|
+
|
|
94
|
+
- name: Run Model-Accuracy Regression Gate
|
|
95
|
+
run: python tests/scripts/evaluate_accuracy.py
|
|
96
|
+
|
|
97
|
+
- name: Run Performance Benchmark Check
|
|
98
|
+
run: python tests/scripts/benchmark_performance.py
|
|
99
|
+
|
|
100
|
+
- name: Upload Coverage to Codecov
|
|
101
|
+
uses: codecov/codecov-action@v4
|
|
102
|
+
with:
|
|
103
|
+
file: ./coverage.xml
|
|
104
|
+
fail_ci_if_error: false
|
|
105
|
+
slug: OBLIQ-in/obliq-OCR
|
|
106
|
+
env:
|
|
107
|
+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
108
|
+
|
|
109
|
+
build-package:
|
|
110
|
+
name: Build & Validate Package
|
|
111
|
+
needs: lint-and-typecheck
|
|
112
|
+
runs-on: ubuntu-latest
|
|
113
|
+
steps:
|
|
114
|
+
- name: Checkout Code
|
|
115
|
+
uses: actions/checkout@v4
|
|
116
|
+
with:
|
|
117
|
+
fetch-depth: 0
|
|
118
|
+
|
|
119
|
+
- name: Set up Python
|
|
120
|
+
uses: actions/setup-python@v5
|
|
121
|
+
with:
|
|
122
|
+
python-version: '3.11'
|
|
123
|
+
cache: 'pip'
|
|
124
|
+
|
|
125
|
+
- name: Install PEP 517 Build Tools
|
|
126
|
+
run: |
|
|
127
|
+
python -m pip install --upgrade pip
|
|
128
|
+
pip install build twine hatch-vcs
|
|
129
|
+
|
|
130
|
+
- name: Build Source Distribution and Wheel
|
|
131
|
+
run: python -m build
|
|
132
|
+
|
|
133
|
+
- name: Check Package Metadata Rendering
|
|
134
|
+
run: twine check dist/*
|
|
135
|
+
|
|
136
|
+
- name: Install Wheel in Isolated Venv & Run Smoke Test
|
|
137
|
+
run: |
|
|
138
|
+
python -m venv .smoke_venv
|
|
139
|
+
source .smoke_venv/bin/activate
|
|
140
|
+
pip install --upgrade pip
|
|
141
|
+
pip install dist/*.whl
|
|
142
|
+
python -c "import obliq_ocr; print('Package imported successfully, version:', obliq_ocr.__version__)"
|
|
143
|
+
obliq-ocr --help
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
name: Docs Site
|
|
2
|
+
|
|
3
|
+
# Builds the docs site on every PR (strict: a broken link or bad reference
|
|
4
|
+
# fails the build) and deploys it to GitHub Pages when a release is published.
|
|
5
|
+
# Run it by hand on main for the first deploy.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
pull_request:
|
|
9
|
+
branches: [ main ]
|
|
10
|
+
paths:
|
|
11
|
+
- 'docs/**'
|
|
12
|
+
- 'src/**'
|
|
13
|
+
- 'README.md'
|
|
14
|
+
- 'mkdocs.yml'
|
|
15
|
+
- 'mkdocs_hooks.py'
|
|
16
|
+
- 'pyproject.toml'
|
|
17
|
+
- '.github/workflows/docs.yml'
|
|
18
|
+
push:
|
|
19
|
+
branches: [ main ]
|
|
20
|
+
paths:
|
|
21
|
+
- 'docs/**'
|
|
22
|
+
- 'src/**'
|
|
23
|
+
- 'README.md'
|
|
24
|
+
- 'mkdocs.yml'
|
|
25
|
+
- 'mkdocs_hooks.py'
|
|
26
|
+
- 'pyproject.toml'
|
|
27
|
+
- '.github/workflows/docs.yml'
|
|
28
|
+
release:
|
|
29
|
+
types: [ published ]
|
|
30
|
+
workflow_dispatch:
|
|
31
|
+
|
|
32
|
+
permissions:
|
|
33
|
+
contents: read
|
|
34
|
+
|
|
35
|
+
concurrency:
|
|
36
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
37
|
+
cancel-in-progress: true
|
|
38
|
+
|
|
39
|
+
jobs:
|
|
40
|
+
build:
|
|
41
|
+
name: Build Docs (strict)
|
|
42
|
+
runs-on: ubuntu-latest
|
|
43
|
+
steps:
|
|
44
|
+
- name: Checkout Code
|
|
45
|
+
uses: actions/checkout@v4
|
|
46
|
+
|
|
47
|
+
# The docs tools need Python 3.11+, even though the package supports 3.10.
|
|
48
|
+
- name: Set up Python
|
|
49
|
+
uses: actions/setup-python@v5
|
|
50
|
+
with:
|
|
51
|
+
python-version: '3.12'
|
|
52
|
+
cache: 'pip'
|
|
53
|
+
|
|
54
|
+
- name: Install Docs Tools
|
|
55
|
+
run: |
|
|
56
|
+
python -m pip install --upgrade pip
|
|
57
|
+
pip install --group docs
|
|
58
|
+
|
|
59
|
+
- name: Build Site
|
|
60
|
+
run: mkdocs build --strict
|
|
61
|
+
env:
|
|
62
|
+
NO_MKDOCS_2_WARNING: '1'
|
|
63
|
+
|
|
64
|
+
- name: Upload Site for Pages
|
|
65
|
+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
|
|
66
|
+
uses: actions/upload-pages-artifact@v3
|
|
67
|
+
with:
|
|
68
|
+
path: site
|
|
69
|
+
|
|
70
|
+
deploy:
|
|
71
|
+
name: Deploy to GitHub Pages
|
|
72
|
+
needs: build
|
|
73
|
+
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
|
|
74
|
+
runs-on: ubuntu-latest
|
|
75
|
+
permissions:
|
|
76
|
+
pages: write
|
|
77
|
+
id-token: write
|
|
78
|
+
environment:
|
|
79
|
+
name: github-pages
|
|
80
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
81
|
+
steps:
|
|
82
|
+
- name: Deploy
|
|
83
|
+
id: deployment
|
|
84
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Secret Scanning (Gitleaks)
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
paths-ignore:
|
|
7
|
+
- '**/*.md'
|
|
8
|
+
- 'docs/**'
|
|
9
|
+
- '.gitignore'
|
|
10
|
+
- '.lychee.toml'
|
|
11
|
+
pull_request:
|
|
12
|
+
branches: [ main ]
|
|
13
|
+
paths-ignore:
|
|
14
|
+
- '**/*.md'
|
|
15
|
+
- 'docs/**'
|
|
16
|
+
- '.gitignore'
|
|
17
|
+
- '.lychee.toml'
|
|
18
|
+
schedule:
|
|
19
|
+
- cron: '0 0 * * 1'
|
|
20
|
+
workflow_dispatch:
|
|
21
|
+
|
|
22
|
+
concurrency:
|
|
23
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
24
|
+
cancel-in-progress: true
|
|
25
|
+
|
|
26
|
+
jobs:
|
|
27
|
+
gitleaks:
|
|
28
|
+
name: Gitleaks Scan
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
steps:
|
|
31
|
+
- name: Checkout Code
|
|
32
|
+
uses: actions/checkout@v4
|
|
33
|
+
with:
|
|
34
|
+
fetch-depth: 0
|
|
35
|
+
|
|
36
|
+
- name: Run Gitleaks Scan via Docker
|
|
37
|
+
uses: docker://zricethezav/gitleaks:latest
|
|
38
|
+
with:
|
|
39
|
+
args: detect --source="/github/workspace" --verbose
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Documentation Link Checker
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
paths:
|
|
7
|
+
- '**/*.md'
|
|
8
|
+
- 'docs/**'
|
|
9
|
+
- '.lychee.toml'
|
|
10
|
+
- '.github/workflows/link-checker.yml'
|
|
11
|
+
pull_request:
|
|
12
|
+
branches: [ main ]
|
|
13
|
+
paths:
|
|
14
|
+
- '**/*.md'
|
|
15
|
+
- 'docs/**'
|
|
16
|
+
- '.lychee.toml'
|
|
17
|
+
- '.github/workflows/link-checker.yml'
|
|
18
|
+
schedule:
|
|
19
|
+
# Run weekly on Sundays at 00:00 UTC to catch dead external links
|
|
20
|
+
- cron: '0 0 * * 0'
|
|
21
|
+
workflow_dispatch:
|
|
22
|
+
|
|
23
|
+
concurrency:
|
|
24
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
25
|
+
cancel-in-progress: true
|
|
26
|
+
|
|
27
|
+
jobs:
|
|
28
|
+
lychee-link-check:
|
|
29
|
+
name: Check Markdown Links
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
steps:
|
|
32
|
+
- name: Checkout Code
|
|
33
|
+
uses: actions/checkout@v4
|
|
34
|
+
|
|
35
|
+
- name: Restore Lychee Cache
|
|
36
|
+
uses: actions/cache@v4
|
|
37
|
+
with:
|
|
38
|
+
path: .lycheecache
|
|
39
|
+
key: cache-lychee-${{ github.sha }}
|
|
40
|
+
restore-keys: cache-lychee-
|
|
41
|
+
|
|
42
|
+
- name: Run Lychee Link Checker
|
|
43
|
+
uses: lycheeverse/lychee-action@v2.3.0
|
|
44
|
+
with:
|
|
45
|
+
args: --config .lychee.toml --no-progress './**/*.md'
|
|
46
|
+
env:
|
|
47
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Pull Request Title Check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, edited, synchronize, reopened]
|
|
6
|
+
|
|
7
|
+
concurrency:
|
|
8
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
9
|
+
cancel-in-progress: true
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
validate-pr-title:
|
|
13
|
+
name: Validate PR Title
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Lint PR Title
|
|
17
|
+
uses: amannn/action-semantic-pull-request@v5
|
|
18
|
+
env:
|
|
19
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
20
|
+
with:
|
|
21
|
+
# Configure permitted conventional commit types
|
|
22
|
+
types: |
|
|
23
|
+
feat
|
|
24
|
+
fix
|
|
25
|
+
docs
|
|
26
|
+
style
|
|
27
|
+
refactor
|
|
28
|
+
perf
|
|
29
|
+
test
|
|
30
|
+
ci
|
|
31
|
+
chore
|
|
32
|
+
revert
|
|
33
|
+
# Require a scope (optional, set to false if scopes shouldn't be strictly mandatory)
|
|
34
|
+
requireScope: false
|
|
35
|
+
# Custom error message for invalid titles
|
|
36
|
+
validateSingleCommit: true
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
name: Release Drafter & Changelog Sync
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
release:
|
|
8
|
+
types: [published]
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: write
|
|
12
|
+
pull-requests: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
update_release_draft:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- name: Run Release Drafter
|
|
19
|
+
uses: release-drafter/release-drafter@v6
|
|
20
|
+
env:
|
|
21
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
22
|
+
|
|
23
|
+
update_changelog:
|
|
24
|
+
if: github.event_name == 'release' && github.event.action == 'published'
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- name: Checkout repository
|
|
28
|
+
uses: actions/checkout@v4
|
|
29
|
+
|
|
30
|
+
- name: Append Release Notes to Changelog
|
|
31
|
+
run: |
|
|
32
|
+
# Create a temp file with the new release entry
|
|
33
|
+
echo "## [${{ github.event.release.tag_name }}] - $(date +%Y-%m-%d)" > new_entry.md
|
|
34
|
+
echo "" >> new_entry.md
|
|
35
|
+
echo "${{ github.event.release.body }}" >> new_entry.md
|
|
36
|
+
echo "" >> new_entry.md
|
|
37
|
+
|
|
38
|
+
# Insert the new entry right below the header in CHANGELOG.md (preserving older entries)
|
|
39
|
+
python3 -c "
|
|
40
|
+
with open('CHANGELOG.md', 'r') as f:
|
|
41
|
+
content = f.read()
|
|
42
|
+
|
|
43
|
+
# Find where '## [Unreleased]' or the first version header starts, and insert above it
|
|
44
|
+
marker = '## [Unreleased]'
|
|
45
|
+
if marker in content:
|
|
46
|
+
parts = content.split(marker)
|
|
47
|
+
new_content = parts[0] + marker + '\n\n' + open('new_entry.md').read() + '---\n\n' + parts[1]
|
|
48
|
+
else:
|
|
49
|
+
new_content = open('new_entry.md').read() + '\n' + content
|
|
50
|
+
|
|
51
|
+
with open('CHANGELOG.md', 'w') as f:
|
|
52
|
+
f.write(new_content)
|
|
53
|
+
"
|
|
54
|
+
rm new_entry.md
|
|
55
|
+
|
|
56
|
+
- name: Commit and Push Changelog
|
|
57
|
+
uses: stefanzweifel/git-auto-commit-action@v5
|
|
58
|
+
with:
|
|
59
|
+
commit_message: "docs(changelog): update CHANGELOG.md for v${{ github.event.release.tag_name }}"
|
|
60
|
+
file_pattern: "CHANGELOG.md"
|