bikramdocsumo commited on
Commit ·
09471fb
1
Parent(s): 3fbb725
Release 1.0.0: Python 3.10+, setuptools 77 floor, single-source version, release workflow
Browse files- Version 1.0.0, read from sumoocr/__init__.py (no second copy in pyproject.toml).
- build-system: setuptools>=77.0.3; the SPDX license string fails to build on older setuptools.
- requires-python >=3.10 and Python 3.10-3.14 classifiers.
- .github/workflows/release.yml: on a v* tag, build with Git LFS models, test the built wheel
on Python 3.10-3.14, publish to PyPI with Trusted Publishing.
Files changed (3)
- .github/workflows/release.ymlAdded+82
- pyproject.toml+12-4
- sumoocr/__init__.py+1-1
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182name: Release
# Pushing a tag vX.Y.Z builds the package, tests the built wheel and publishes it to PyPI with# Trusted Publishing (no stored token). One-time setup on pypi.org: the project's Publishing page,# add a GitHub publisher for this repository, workflow "release.yml", environment "pypi".# Run by hand (workflow_dispatch) it builds and tests only.on: push: tags: ["v*"] workflow_dispatch:
permissions: contents: read
jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 with: lfs: true # the .onnx models are Git LFS files: without this the wheel ships 130-byte pointers - uses: astral-sh/setup-uv@v6 - name: Models are real files, not Git LFS pointers run: | for f in sumoocr/models/det.onnx sumoocr/models/rec.onnx; do test "$(wc -c < "$f")" -gt 100000 || { echo "::error::$f is a Git LFS pointer"; exit 1; } done - name: Tag matches the package version if: startsWith(github.ref, 'refs/tags/v') run: | version=$(sed -n 's/^__version__ = "\(.*\)"$/\1/p' sumoocr/__init__.py) test "v$version" = "$GITHUB_REF_NAME" || { echo "::error::tag $GITHUB_REF_NAME, package $version"; exit 1; } - run: uv build - run: uvx twine check --strict dist/* - uses: actions/upload-artifact@v4 with: name: dist path: dist/ if-no-files-found: error
test: needs: build runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest] python: ["3.10", "3.11", "3.12", "3.13", "3.14"] include: - { os: macos-latest, python: "3.12" } - { os: windows-latest, python: "3.12" } steps: - uses: actions/checkout@v5 with: lfs: true # examples/invoice.png, read by the tests - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - uses: actions/download-artifact@v4 with: name: dist path: dist - name: Test the built wheel, not the source tree shell: bash run: | rm -rf sumoocr python -m pip install dist/*.whl pytest python -m pytest -q tests
publish: needs: test if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest environment: pypi permissions: id-token: write # Trusted Publishing (OIDC) steps: - uses: actions/download-artifact@v4 with: name: dist path: dist - uses: pypa/gh-action-pypi-publish@release/v1123456789101112131415162 unmodified lines19202122232414 unmodified lines3940414243[build-system]requires = ["setuptools>=68", "wheel"]build-backend = "setuptools.build_meta"[project]name = "sumoocr"version = "0.1.0"description = "SumoOCR tiny: a 1M-parameter CPU OCR pipeline for business documents in Latin-script languages"dynamic = ["readme"] # built from README.md by setup.pylicense = "Apache-2.0"license-files = ["LICENSE", "NOTICE"]authors = [{ name = "Docsumo" }]requires-python = ">=3.9"dependencies = ["numpy>=1.23","opencv-python-headless>=4.8",2 unmodified lineskeywords = ["ocr", "text-recognition", "documents", "invoices", "receipts", "onnx", "cpu"]classifiers = ["Programming Language :: Python :: 3","Operating System :: OS Independent","Intended Audience :: Developers","Topic :: Scientific/Engineering :: Image Recognition",14 unmodified lines[tool.setuptools]packages = ["sumoocr"][tool.setuptools.package-data]sumoocr = ["models/*.onnx", "models/*.json"]1234567891011121314152 unmodified lines18192021222324252627282914 unmodified lines4445464748495051[build-system]requires = ["setuptools>=77.0.3"] # 77.0.3: SPDX `license` string and `license-files` (PEP 639)build-backend = "setuptools.build_meta"[project]name = "sumoocr"description = "SumoOCR tiny: a 1M-parameter CPU OCR pipeline for business documents in Latin-script languages"dynamic = ["version", "readme"] # version: sumoocr/__init__.py; readme: built from README.md by setup.pylicense = "Apache-2.0"license-files = ["LICENSE", "NOTICE"]authors = [{ name = "Docsumo" }]requires-python = ">=3.10"dependencies = ["numpy>=1.23","opencv-python-headless>=4.8",2 unmodified lineskeywords = ["ocr", "text-recognition", "documents", "invoices", "receipts", "onnx", "cpu"]classifiers = ["Programming Language :: Python :: 3","Programming Language :: Python :: 3 :: Only","Programming Language :: Python :: 3.10","Programming Language :: Python :: 3.11","Programming Language :: Python :: 3.12","Programming Language :: Python :: 3.13","Programming Language :: Python :: 3.14","Operating System :: OS Independent","Intended Audience :: Developers","Topic :: Scientific/Engineering :: Image Recognition",14 unmodified lines[tool.setuptools]packages = ["sumoocr"][tool.setuptools.dynamic]version = { attr = "sumoocr.__version__" }[tool.setuptools.package-data]sumoocr = ["models/*.onnx", "models/*.json"]
7 unmodified lines8910117 unmodified linesfrom .ocr import Line, SumoOCR__all__ = ["SumoOCR", "Line"]__version__ = "0.1.0"7 unmodified lines8910117 unmodified linesfrom .ocr import Line, SumoOCR__all__ = ["SumoOCR", "Line"]__version__ = "1.0.0"
.github/workflows/release.ymlAdded+82
pyproject.toml+12-4
sumoocr/__init__.py+1-1