- Push access to
davanstrien/ocr-benchon GitHub - Trusted publishing configured on PyPI:
- PyPI project:
ocr-bench - Repository:
davanstrien/ocr-bench - Workflow:
release.yml - Environment:
pypi
- PyPI project:
- GitHub environment
pypiexists (Settings > Environments) - Branch protection on
main(require PR + passing CI)
-
Create a release branch:
git checkout -b release/0.0.2
-
Bump the version in
pyproject.toml:version = "0.0.2" -
Update the lockfile:
uv lock
-
Run checks locally:
uv run ruff check src/ tests/ uv run pytest tests/ -x -q
-
Commit and push:
git add pyproject.toml uv.lock git commit -m "Bump version to 0.0.2" git push -u origin release/0.0.2 -
Open a PR against
main:gh pr create --title "Release 0.0.2" --body "Bump version to 0.0.2"
CI runs automatically on the PR. Review and merge once green.
-
Tag the release (after merge):
git checkout main && git pull git tag v0.0.2 git push origin v0.0.2Or create a GitHub Release in the UI — set the tag to
v0.0.2targetingmain, which creates the tag and triggers the publish workflow. -
Watch the publish workflow:
gh run list --limit 1 gh run watch <run-id>
-
Verify:
pip install ocr-bench==0.0.2 ocr-bench --help
Lint (ruff) + tests (pytest). This is the check required by branch protection.
- test job: same lint + tests as CI
- publish job: build wheel > smoke test import > publish via trusted publishing
Go to Settings > Branches > Add rule for main:
- Require a pull request before merging
- Require status checks to pass: select
test(from the CI workflow) - Do not allow bypassing the above settings (optional, but recommended)
- Lockfile out of sync: CI uses
--locked, so always runuv lockafter changingpyproject.toml - Missing dev tool in CI: Dev dependencies (ruff, pytest) must be in
[dependency-groups] dev - test_web.py fails in CI: Needs
--extra viewersince FastAPI is optional - PyPI rejects upload: PyPI doesn't allow re-uploading the same version. If publish failed after a partial upload, you'll need to bump to a new version.
SemVer. Currently 0.0.x (proof of concept). Bump to 0.1.0 when the API stabilises.