Skip to content

Restructure into 3 packages for optional, prebuilt engine distribution#21

Merged
JSv4 merged 2 commits into
mainfrom
packaging-optional-engines
May 22, 2026
Merged

Restructure into 3 packages for optional, prebuilt engine distribution#21
JSv4 merged 2 commits into
mainfrom
packaging-optional-engines

Conversation

@JSv4
Copy link
Copy Markdown
Owner

@JSv4 JSv4 commented May 22, 2026

Summary

Restructures the project into a monorepo of three separately-published PyPI packages so comparison engines can be installed optionally, with prebuilt binaries embedded in the wheels — no .NET SDK and no local compilation needed to install or use the library.

Package PyPI name Wheel Contents
packages/core python-redlines py3-none-any Pure-Python wrapper
packages/ooxmlpowertools python-redlines-ooxmlpowertools per-platform Open-XML-PowerTools binary
packages/docxodus python-redlines-docxodus per-platform Docxodus binary

Engines install via extras: pip install python-redlines[docxodus] / [ooxmlpowertools] / [all]. Docxodus is the default/recommended engine.

Why

The previous packaging bundled every platform's binary for both engines into a single py3-none-any wheel (~900 MB projected) — unpublishable on PyPI (100 MB/file limit), wrong platform tag, and hatch/hatchling leaked in as runtime deps. This makes genuine optional engines impossible (extras gate dependency packages, not files within one wheel).

Changes

  • Per-platform wheelshatch_build.py build hook stamps each engine wheel with the correct platform tag (manylinux2014_x86_64, macosx_11_0_arm64, win_amd64, …). Each engine wheel is ~34–39 MB, well under PyPI limits; pip auto-selects the matching wheel.
  • engines.py — locates its binary via importlib.resources, extracts the platform archive into the user cache dir (not read-only site-packages), and raises EngineNotInstalledError with install guidance when a companion package is missing.
  • build_differ.py — reworked to build a given RID into each package's _binaries/ dir.
  • CIci.yml tests per-OS and builds all wheels; python-publish.yml builds per-platform engine wheels across 3 OS runners and publishes all three packages in lockstep (single version source in packages/core/.../__about__.py).
  • Dropped the hatch/hatchling runtime deps and the build-on-install hook.
  • README/CLAUDE.md/docs updated for the new structure; README leads with Docxodus as the default engine.

Test plan

  • All 3 wheels build clean; twine check passes; correct platform tags; no leaked files
  • pip install python-redlines[all] / [docxodus] / core-only all behave correctly (incl. EngineNotInstalledError)
  • 21/21 tests pass against installed wheels and against editable installs
  • Binaries extract to user cache dir, not site-packages
  • Non-linux-x64 platforms (linux-arm64, win-*, osx-*) — wired up but only exercised by CI; not verified locally

🤖 Generated with Claude Code

JSv4 and others added 2 commits May 22, 2026 01:52
Split the project into a monorepo of three separately-published packages so
engines can be installed optionally with binaries embedded in PyPI wheels:

- python-redlines (packages/core): pure-Python wrapper, py3-none-any wheel
- python-redlines-ooxmlpowertools: Open-XML-PowerTools binary, per-platform wheels
- python-redlines-docxodus: Docxodus binary, per-platform wheels

Engines install via extras: pip install python-redlines[docxodus|ooxmlpowertools|all].
Binaries are prebuilt per platform and embedded in each binary package's wheel, so
no .NET SDK or local compilation is needed to install or use the library.

- engines.py locates its binary package via importlib.resources, extracts the
  platform archive into the user cache dir (not site-packages), and raises
  EngineNotInstalledError with install guidance when a companion package is missing
- hatch_build.py stamps each binary wheel with the correct platform tag
- build_differ.py builds a given RID into each package's _binaries/ dir
- CI builds per-platform wheels across 3 OS runners; release publishes all three
- Drop hatch/hatchling runtime deps and the build-on-install hook

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Rework the README intro into a Quick Start that leads with Docxodus as the
default, recommended engine and the optional prebuilt-engine install model.
Drop the now-redundant Quick Example section.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JSv4 JSv4 force-pushed the packaging-optional-engines branch from 9a7a876 to d793874 Compare May 22, 2026 07:12
@JSv4 JSv4 merged commit 4874549 into main May 22, 2026
13 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