Skip to content

[mpxpy] Automate PyPI releases; add convert_to_xlsx and include_hyperlinks - #21

Merged
mattmathpix merged 6 commits into
masterfrom
feature/mpxpy/release-automation-and-new-options
Sep 22, 2026
Merged

mattmathpix merged 6 commits into
masterfrom
feature/mpxpy/release-automation-and-new-options

Conversation

@mattmathpix

@mattmathpix mattmathpix commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Automate mpxpy's PyPI releases and add two missing API options.

Release automation

New .github/workflows/release.yml, modeled on the mathpix-cli release workflow:

  • Version: derived from the git tag via setuptools-scm (pyproject.toml uses dynamic = ["version"]), so there is no version to bump by hand. The tag is the single source of truth.
  • Trigger: push a vX.Y.Z tag.
  • Guards (fail before anything is published): tag is valid semver, is on master, and is newer than the last release.
  • Steps: install → run offline unit tests → python -m build → twine check → publish to PyPI → create a published (non-draft) GitHub release with generated notes.
  • Auth: a PYPI_API_TOKEN repo secret (same __token__ credential deploy.sh uses today).

Cutting a release is just:

git checkout master && git pull
git tag -a v0.0.23 -m "mpxpy v0.0.23"
git push origin v0.0.23

New API options (all verified against ocr-api)

  • convert_to_mmd_overlay_pdf on pdf_new for the new mmd.overlay.pdf format from the accessible-PDF release: your submitted PDF returned with an invisible, screen-reader-ready text layer (PDF/UA tagged by default; PDF input only). Adds to_mmd_overlay_pdf_file / to_mmd_overlay_pdf_bytes on Pdf and File; the format's options pass through the existing conversion_options["mmd.overlay.pdf"] dict.
  • convert_to_xlsx on pdf_new and conversion_new, plus to_xlsx_file / to_xlsx_bytes on Pdf and Conversion. xlsx was the only supported conversion format without a convenience flag.
  • include_hyperlinks on pdf_new (extracts PDF link annotations into per-line links data); added to _PDF_REQUEST_OPTION_KEYS.

Changelog updated. The first tag must be v0.0.23 or higher, since 0.0.22 is already on PyPI.

One-time setup required before the first tagged release

Add the existing PyPI token as a repo secret named PYPI_API_TOKEN
(Settings → Secrets and variables → Actions). Until it exists the publish step fails.

Testing

  • 87/87 offline unit tests pass (incl. 3 new ones covering the options).
  • With a v0.0.23 tag, python -m build stamps the version 0.0.23 into mpxpy-0.0.23.tar.gz/.whl; twine check passes.

Triggered by user request to automate mpxpy PyPI releases via GH Actions and add missing API options.

…links

Add .github/workflows/release.yml: pushing a vX.Y.Z tag from master builds
the sdist/wheel, runs the offline unit tests, publishes to PyPI via trusted
publishing, and creates a published (non-draft) GitHub release. Guards reject
a tag that is not semver, not on master, out of sync with the pyproject
version, or not newer than the last release.

Add convert_to_xlsx to pdf_new and conversion_new (and to_xlsx_file/
to_xlsx_bytes on Pdf and Conversion), and include_hyperlinks to pdf_new.
Bump version to 0.0.23.

Triggered by user request to automate mpxpy PyPI releases via GH Actions and
add missing API options.
@mattmathpix
mattmathpix merged commit 067357f into master Sep 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant